in reply to Re^4: Comparing a value to a list of numbers
in thread Comparing a value to a list of numbers
I doubt this, rounding errors happen only after arithmetic operations
as long as two floats are different, comparisons will show a strict order:
DB<95> $one = 1-1e-16 DB<96> printf '%.17f', $one 0.99999999999999989 DB<97> p 1 > $one 1 DB<98> $one = 1-1e-16 DB<99> p $one 1 DB<100>
FWIW 0.1e-1 and 1e-2 are the same float in my books.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Comparing a value to a list of numbers (updated)
by haukex (Archbishop) on Feb 01, 2021 at 18:18 UTC | |
by syphilis (Archbishop) on Feb 02, 2021 at 01:38 UTC | |
by haukex (Archbishop) on Feb 03, 2021 at 10:48 UTC | |
by LanX (Saint) on Feb 01, 2021 at 18:36 UTC |