On Sun, May 3, 2009 at 3:07 PM, Bill Ward <b...@wards.net> wrote:

> For my module Number::Format I am getting a strange result from cpan
> testers that I can't replicate.  See this error report...
> http://www.nntp.perl.org/group/perl.cpan.testers/2009/03/msg3560533.html
>
> #   Failed test 'pi with precision=6'
> #   at t/round.t line 18.
> #          got: 3.141593
> #     expected: 3.141593
>
> That's my report.  Perl is compiled with "-Dusemorebits" (64int-ld) and is
thus using "long doubles".  That tends to trip up direct comparisions of
floating point.

For floating point comparison, I usually recommend Test::Number::Delta.
However, given that your module is about formatting stuff, maybe the best
approach is forcing string comparison.

>From a quick test -- using 'eq' instead of '==' in your modules passes tests
on my system.

-- David

Reply via email to