On Fri, Dec 15, 2017 at 1:36 PM, Bart <bartjun...@gmail.com> wrote: > Procedure BuildUp(const ASignFlag: Boolean; const AMantissa: QWord; > const AExponent: Integer);
Basically the current implementation does this: Self := 0.0; TExtended80Rec(Self)._Exp:=(TExtended80Rec(Self)._Exp and $7FFF) or (ord(AsignFlag) shl 15); //which is what TExtended80Rec(Self).Sign := ASignFlag does TExtended80Rec(Self).Frac := AMantissa and $000FFFFFFFFFFFFF; TExtended80Rec(Self)._Exp:=(TExtended80Rec(Self)._Exp and $8000) or ((AExponent+$3FF) and $7FFF); //where does the +$3FF come from? Possibly this should be: Self := 0.0; TExtended80Rec(Self)._Exp:=(TExtended80Rec(Self)._Exp and $7FFF) or (ord(AsignFlag) shl 15); TExtended80Rec(Result).Frac := AMantissa or $8000000000000000; TExtended80Rec(Result)._Exp := (Textended80Rec(Result)._Exp and $8000) or (AExp and $7FFFF); I'm not very good with bit manipulation, so I may be way off here. Bart _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal