Subject: | Fails due to different stringifications of floating point numbers |
As per subject.
There are many more fail reports on cpantesters but I've identified a
class of fail reports that is due to wrong expectation on the
stringification of floats in the test suite. See for example test report
http://www.cpantesters.org/cpan/report/12976938
It contains among other diagnostics:
# Failed test 'calculation test'
# at t/frustum_of_right_circular_cone.t line 29.
# '1576.37795279636923'
# doesn't match '(?-xism:1576.37795279637)'
You see the test is expecting a slightly different stringification in
the least significant parts of the mantissa, You should account for that
because stringification varies with architecture. Floating point numbers
aer imprecise and it's on the developer to deal with this difference.
HTH, Thanks && Regards,