in reply to Re^2: int() function
in thread int() function
IMO, if $x is an NV, then the condition "$x" == $x should always be true unless $x is NaN.C:\_32>perl -MTest::More -le "cmp_ok(0.14, '==', 1.4 / 10, '0.14 == 1. +4/10'); done _testing();" not ok 1 - 0.14 == 1.4/10 # Failed test '0.14 == 0.14' # at -e line 1. # got: 0.14 # expected: 0.14 1..1 # Looks like you failed 1 test of 1.
Cheers,C:\>perl -MMath::MPFR="nvtoa" -le "print nvtoa(0.14);print nvtoa(1.4 / + 10);" 0.14 0.13999999999999999
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: int() function
by LanX (Saint) on Oct 25, 2020 at 12:09 UTC | |
by syphilis (Archbishop) on Oct 25, 2020 at 13:05 UTC | |
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 | |
|