45 #include "CACFNumber.h"
51 Float32 CACFNumber::GetFixed32()
const
53 SInt32 theFixedValue = GetSInt32();
56 Float32 theSign = theFixedValue < 0 ? -1.0f : 1.0f;
57 theFixedValue *= (SInt32)theSign;
58 Float32 theWholePart = (theFixedValue & 0x7FFF0000) >> 16;
59 Float32 theFractPart = theFixedValue & 0x0000FFFF;
60 theFractPart /= 65536.0f;
62 return theSign * (theWholePart + theFractPart);
65 Float64 CACFNumber::GetFixed64()
const
67 SInt64 theFixedValue = GetSInt64();
70 Float64 theSign = theFixedValue < 0 ? -1.0 : 1.0;
71 theFixedValue *= (SInt64)theSign;
72 Float64 theWholePart = (theFixedValue & 0x7FFFFFFF00000000LL) >> 32;
73 Float64 theFractPart = theFixedValue & 0x00000000FFFFFFFFLL;
74 theFractPart /= 4294967296.0;
76 return theSign * (theWholePart + theFractPart);