function power
Summary
System Information
- Operating system: win 10 pro
- Processor architecture: 64-bit
- Compiler version: 3.2.2
- Device: PC
Steps to reproduce
NA
Example Project
NA
What is the current bug behavior?
I don't know if it is worth to open for a code modification request but this line on "power" routine
if (abs(exponent)<=maxint) and (frac(exponent)=0.0) then
should be better rewritten as
if (frac(exponent)=0.0) and (abs(exponent)<=maxint) then
because I think in 99% of cases the frac(exponent)=0.0 shall be false, and the subsequent check is skipped if short boolean evalutation is in place. In my view it is also the logical sequence, only if exponent is an integer I'll check if it is in the range... (checked also on Delphi, it implements what here suggested)