summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;