in reply to Re^4: int() function
in thread int() function
Between 0x1.6a...c3d and 0x1.6a...c6a there exists 45 doubles with distinct, precise values. (c6a - c3d == 2d == 45 in base 10)C:\perl -le "printf '%a', 1.41421356237312;" 0x1.6a09e667f3c3dp+0 C:\>perl -le "printf '%a', 1.41421356237313;" 0x1.6a09e667f3c6ap+0
Python3 will always output the minimum number of decimal digits needed to preserve the uniqueness of the given value. And, last time I checked, raku was outputting exactly the same as python3 - for "doubles", anyway.$ python3 -c "print(0.14)" 0.14 $ python3 -c "print(1.4 / 10)" 0.13999999999999999 $ python3 -c "print(2 ** 0.5)" 1.4142135623730951
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: int() function
by LanX (Saint) on Oct 25, 2020 at 18:21 UTC | |
by syphilis (Archbishop) on Oct 26, 2020 at 02:28 UTC | |
by pryrt (Abbot) on Oct 26, 2020 at 13:39 UTC | |
by syphilis (Archbishop) on Oct 26, 2020 at 23:57 UTC |