in reply to Re^3: Anyone with XS experience willing to create a high performance data type for Perl?
in thread Anyone with XS experience willing to create a high performance data type for Perl?
10 and 99 (1E1 and 9.9E1) are the same order of magnitude, but 99 and 100 (9.9E1 and 1E2) are different orders of magnitude
No. That's the problem with taking such a definition literally. The "order of magnitude" of a number is its base-10 logarithm, usually rounded to the nearest whole number.
Try this: round( log10(X) - log10(Y) )
In terms of "order of magnitude", 99 and 100 are the same number.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Anyone with XS experience willing to create a high performance data type for Perl?
by talexb (Chancellor) on Nov 11, 2021 at 01:05 UTC | |
by jdporter (Paladin) on Nov 14, 2021 at 14:51 UTC | |
by talexb (Chancellor) on Nov 14, 2021 at 23:09 UTC | |
by jdporter (Paladin) on Nov 15, 2021 at 14:56 UTC | |
by talexb (Chancellor) on Nov 15, 2021 at 17:25 UTC | |
| |
by LanX (Saint) on Nov 11, 2021 at 01:15 UTC |
In Section
Seekers of Perl Wisdom