in reply to Re^3: Unexpected behaviour with PERL5OPT
in thread Unexpected behaviour with PERL5OPT
In fact it should fail and I expect it to fail.>perl -MPOSIX -MTest::More -le "cmp_ok(1.4/10, '==', 0.14, 'division') +; done_testing();" not ok 1 - division # Failed test 'division' # at -e line 1. # got: 0.14 # expected: 0.14 1..1 # Looks like you failed 1 test of 1.
which actually tells us what the 2 values were.>perl -MPOSIX -MTest::More -le "cmp_ok(1.4/10, '==', 0.14, 'division') +; done_testing();" not ok 1 - division # Failed test 'division' # at -e line 1. # got: 0.13999999999999999 # expected: 0.14 1..1 # Looks like you failed 1 test of 1.
Usual practice seems to be that "-tan(-1)" is mostly calculated as "tan(1)", and that would mean that the test should pass by tautology (as it usually does).not ok 40 - tan(1) == -tan(-1) # Failed test 'tan(1) == -tan(-1)' # at ext/POSIX/t/math.t line 52. # got: 1.55740772465490223050697480745836 # expected: 1.55740772465490223050697480745836
I'll post again to this thread with a link to the Test::Simple PR once I've submitted it.not ok 40 - tan(1) == -tan(-1) # Failed test 'tan(1) == -tan(-1)' # at ext/POSIX/t/math.t line 52. # got: 1.55740772465490223050697480745836023 # expected: 1.55740772465490223050697480745836081
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Unexpected behaviour with PERL5OPT
by choroba (Cardinal) on Oct 25, 2024 at 10:05 UTC | |
by syphilis (Archbishop) on Oct 25, 2024 at 12:27 UTC | |
Re^5: Unexpected behaviour with PERL5OPT
by syphilis (Archbishop) on Oct 29, 2024 at 11:23 UTC |