summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Checkmate50 <dgeisler50@gmail.com>2016-07-19 11:56:01 -0600
committerGravatar Checkmate50 <dgeisler50@gmail.com>2016-07-19 11:56:01 -0600
commit6bf5043aeab0430325c4ccde3e6ca3bd82d96704 (patch)
treea5a31ea3700cef05d44c14f76b85b9e279c9c4df
parentf3f704edfb2cd1021d811050c72694767710217f (diff)
fixed floatceiling function
-rw-r--r--Source/Basetypes/BigFloat.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Basetypes/BigFloat.cs b/Source/Basetypes/BigFloat.cs
index 5f711e70..3816a22d 100644
--- a/Source/Basetypes/BigFloat.cs
+++ b/Source/Basetypes/BigFloat.cs
@@ -314,14 +314,15 @@ namespace Microsoft.Basetypes
BIM two = new BIM(2);
BIM sig = Significand + BIM.Pow(two, SignificandSize); //Add hidden bit
- BIM exp = Exponent - BIM.Pow(two, ExponentSize);
- sig = sig >> ExponentSize;
+ BIM exp = Exponent - BIM.Pow(two, ExponentSize-1) + 1;
while (exp > BIM.Zero) {
exp--;
- sig = sig >> 1;
+ sig = sig << 1;
}
+ sig = sig >> SignificandSize;
+
if (isNeg) {
ceiling = -sig + 1;
floor = -sig;