Closed PootieT closed 1 year ago
@mgree and @mhyee any opinions on this one? (We can save it until after the deadline this week.)
Every language suffers from the usual floating point equality issues. I don't see anything Perl specific here, though:
$ perl -e 'print(6.00 == 6.0); print("\n")'
1
I wonder if eq_deeply is somehow more pedantic.
$ perl -e 'use Test::Deep; print(eq_deeply(6.00, 6)); print("\n")'
1
$ perl -e 'use Test::Deep; print(eq_deeply(6.00, 6.0)); print("\n")'
1
Example test:
HumanEval_71_triangle_area
An output value of
6.00
would not pass the first testeq_deeply(6.00, 6.0)
. Seems like the same unit test library has thisis_deeply_float
function that maybe useful here? link