Closed iga2iga closed 1 year ago
Are you sure it's not just a typical rounding error/floating point inaccuracy ?
Actually I don't remember where i faced the problem. But rtl definitely returns zero. System.Math.Power(0.474733531475067, 150) = 0 while neslib.FastMath.FastPower(0.474733531475067, 150) returns -3,35626519513237e+28
I can see several reasons for this:
But I think the issue is mostly related to reasons 1 and 2 above. If precision is important, then don't use the Fast* versions and use Delphi version that offer at least Double precision.
FastPower(Single, Single) does not work with Base = 0,474733531475067 eg and Exponent = 150, should return zero. The same checks as in rtl before Result := FastExp2(AExponent * FastLog2(ABase)); make it work as it should.