Only one test fails, and it happens on only one os/archname (OpenBSD.amd64-openbsd-thread-multi-ld) and on these two versions of Perl: 5.24.3 and 5.26.1. There are many passes (606) across all OS's.
The failing test is:
This is when the test calls format_pref(1e-33). 1000e-36 is the same numeric value as 1e-33, but the point of this function is to display the number with a specific format.# Failed test at t/format_pref.t line 54. # got: '1000e-36' # expected: '1e-33'
I can't reproduce this because I don't have this OS or Perl version. But, from the tester report, I assume it fails on this line in FormatEng.pm:
where floor is from POSIX.my $e = floor( log($num) / log(1000) );
When the test passes, $num=1e-33, and $e is -11. When the test fails, I assume $e is -12. Perhaps log(1e-33)/log(1000) evaluates to -11.0001, or -11.1, or -11.2, etc.
Is it possible for me to fix the code to make it more portable? Or, is there a known problem with this OS for these Perl versions?
In reply to Portability of floor(log(N)) by toolic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |