X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Fbinfloat.cpp;h=50fe5c53329331b3b6661ba5e0bb5874ed596e67;hp=fa4be738b8a472f99f5292500580686237535f75;hb=0d925901d1446de6fe76616b9b2e731d7702571e;hpb=9c95942d24a92abea14bb9e11d33daae2d017321 diff --git a/source/binfloat.cpp b/source/binfloat.cpp index fa4be73..50fe5c5 100644 --- a/source/binfloat.cpp +++ b/source/binfloat.cpp @@ -7,9 +7,9 @@ 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<