From it's signature I would expect that it constructs a float from the
I also assumed that this would be reciprocal: if I query Sign,
Mantissa and Exponent from a given float, then uses BuildUp with these
parameters, I would get a float with the original value back:
This however seems not to be the case.
On Fri, Dec 15, 2017 at 2:51 PM, Vojtěch Čihák <[hidden email]> wrote:
> it seems there is something wrong with helpers or Lazarus is fooled from
> When I find procedure TExtendedHelper.BuidUp() in syshelph.inc and hit
> Ctrl+Shift+Up, it takes me to TFLOATHELPER.BuildUp() implementation in
> And when I hit Alt+Up, it takes me back to declaration in syshelph.inc, but
> to TSingleHelper!
Yep, it does not like the clever implementation (defining types and
then using the same code by including the same includefile multiple
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.