diff options
author | Checkmate50 <dgeisler50@gmail.com> | 2015-09-17 03:14:27 -0600 |
---|---|---|
committer | Checkmate50 <dgeisler50@gmail.com> | 2015-09-17 03:14:27 -0600 |
commit | 28a20e6eba2919e008f70874b4c12a3ce7ad049c (patch) | |
tree | 58050f22ea944eb07620195303d757424f50b2a9 /Source/Basetypes | |
parent | bb5395b35dcea5078c9b38a2f091f26256faac34 (diff) |
Added initial support for float addition
Diffstat (limited to 'Source/Basetypes')
-rw-r--r-- | Source/Basetypes/BigFloat.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Basetypes/BigFloat.cs b/Source/Basetypes/BigFloat.cs index 1fb05005..33860a4f 100644 --- a/Source/Basetypes/BigFloat.cs +++ b/Source/Basetypes/BigFloat.cs @@ -17,7 +17,7 @@ namespace Microsoft.Basetypes /// <summary> /// A representation of a 32-bit floating point value - /// Note that this value has a 1-bit sign, 8-bit exponent, and 23-bit mantissa + /// Note that this value has a 1-bit sign, 8-bit exponent, and 24-bit mantissa /// </summary> public struct BigFloat { @@ -85,17 +85,17 @@ namespace Microsoft.Basetypes [Pure] public static BigFloat FromInt(int v) { - return new BigFloat(v, 0, 23, 8); //TODO: modify for correct fp representation + return new BigFloat(v, 0, 24, 8); //TODO: modify for correct fp representation } [Pure] public static BigFloat FromBigInt(BIM v) { - return new BigFloat(0, v, 8, 23); //TODO: modify for correct fp representation + return new BigFloat(0, v, 8, 24); //TODO: modify for correct fp representation } public static BigFloat FromBigDec(BIM v) { - return new BigFloat(0, v, 8, 23); //TODO: modify for correct fp representation + return new BigFloat(0, v, 8, 24); //TODO: modify for correct fp representation } [Pure] @@ -107,9 +107,9 @@ namespace Microsoft.Basetypes { switch (vals.Length) { case 1: - return Round(vals[0], 8, 23); + return Round(vals[0], 8, 24); case 2: - return new BigFloat(Int32.Parse(vals[0]), BIM.Parse(vals[1]), 8, 23); + return new BigFloat(Int32.Parse(vals[0]), BIM.Parse(vals[1]), 8, 24); case 3: return Round(vals[0], Int32.Parse(vals[1]), Int32.Parse(vals[2])); case 4: |