X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinfloat.cpp;h=c6097d86cacc69dc4015fa896b72aa66d5bd0840;hb=HEAD;hp=fa4be738b8a472f99f5292500580686237535f75;hpb=19179a622c1de88de5ed7047643eec79f285bf2a;p=libs%2Fdatafile.git diff --git a/source/binfloat.cpp b/source/binfloat.cpp index fa4be73..c6097d8 100644 --- a/source/binfloat.cpp +++ b/source/binfloat.cpp @@ -3,13 +3,12 @@ using namespace std; - namespace Msp { namespace DataFile { -BinFloat BinFloat::explode(UInt64 value, const Bits &bits) +BinFloat BinFloat::explode(uint64_t value, const Bits &bits) { - UInt64 mantissa_mask = (UInt64(1)<>1); // Shift down and round the mantissa - UInt64 rounded_mantissa = ((mantissa>>(62-bits.mantissa))+1)>>1; + uint64_t rounded_mantissa = ((mantissa>>(62-bits.mantissa))+1)>>1; // If the integer part is greater than one, we need to use a higher exponent if((rounded_mantissa>>bits.mantissa)>1) ++biased_exponent; if(biased_exponent>=exponent_mask || infinity) // Overflow, return infinity - return UInt64(sign<