in reply to Re^3: Portability of floor(log(N))
in thread Portability of floor(log(N))
And, IIUC, the test script should accept '1000e-36' as correct when NV precision is 64 bits
Alternatively (and since you're already using POSIX) you should get the result you expected, if you replace the log() calls with POSIX::log10(). That way both numerator and divisor should be exact (for these particular inputs), as should also be the result of the division ... irrespective of the precision of the NV:
Rob
Alternatively (and since you're already using POSIX) you should get the result you expected, if you replace the log() calls with POSIX::log10(). That way both numerator and divisor should be exact (for these particular inputs), as should also be the result of the division ... irrespective of the precision of the NV:
Cheers,$ perl -MPOSIX -le 'print POSIX::floor(POSIX::log10(1e-33) / POSIX::lo +g10(1000));' -11
Rob
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Portability of floor(log(N))
by toolic (Bishop) on Mar 14, 2018 at 17:31 UTC | |
by pryrt (Abbot) on Mar 14, 2018 at 18:22 UTC |
In Section
Seekers of Perl Wisdom