Added missing comment; minor cosmetic fixes
git-svn-id: file:///srv/devel/repo-conversion/nusu@200 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
1ac86eebb0
commit
d0f0e3d2c8
|
@ -124,7 +124,8 @@ namespace Nuclex.Support {
|
|||
const int ExponentBias = 127; // Bias subtraced from exponent
|
||||
const int NumericBitCount = 31; // Bits without sign
|
||||
|
||||
// You don't need modify these as they're calculated based on the
|
||||
// You don't need modify these as they're calculated based on
|
||||
// the constants assigned above.
|
||||
const int FractionalBits = (2 << FractionalBitCount) - 1;
|
||||
const int HighestFractionalBit = (1 << FractionalBitCount);
|
||||
const int FractionalBitCountPlusOne = FractionalBitCount + 1;
|
||||
|
@ -223,14 +224,15 @@ namespace Nuclex.Support {
|
|||
const int ExponentBias = 1023; // Bias subtraced from exponent
|
||||
const int NumericBitCount = 63; // Bits without sign
|
||||
|
||||
// You don't need modify these as they're calculated based on the
|
||||
// You don't need modify these as they're calculated based on
|
||||
// the constants assigned above.
|
||||
const long FractionalBits = (2L << FractionalBitCount) - 1;
|
||||
const long HighestFractionalBit = (1L << FractionalBitCount);
|
||||
const int FractionalBitCountPlusOne = FractionalBitCount + 1;
|
||||
|
||||
long intValue = FloatHelper.ReinterpretAsLong(value);
|
||||
long exponent = ((intValue >> FractionalBitCount) & ExponentBits) - ExponentBias;
|
||||
long mantissa = (intValue & FractionalBits) | HighestFractionalBit;
|
||||
long longValue = FloatHelper.ReinterpretAsLong(value);
|
||||
long exponent = ((longValue >> FractionalBitCount) & ExponentBits) - ExponentBias;
|
||||
long mantissa = (longValue & FractionalBits) | HighestFractionalBit;
|
||||
|
||||
long integral;
|
||||
long fractional;
|
||||
|
@ -254,7 +256,7 @@ namespace Nuclex.Support {
|
|||
}
|
||||
|
||||
// Build the integral part
|
||||
if(intValue < 0) {
|
||||
if(longValue < 0) {
|
||||
builder.Append('-');
|
||||
}
|
||||
if(integral == 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user