I recently added a new test to Geo::ReadGRIB and started getting fails from CPAN Testers only on 64bit Perls where nvtype='long double' and nvsize= 12 or 16.
I found the problem is in a floating point calculation for some values of the variables. The problem code fragment is:
$out = (( ($lat - $self->La1) / $self->LaInc ) * $self->Ni) + (($thislong ) / $self->LoInc); return sprintf "%d", $out;
This will work for most values but as an example of the problem, the following test will fail on 64bit uselongdouble Perls:
my $calc = sprintf "%d",(((63 - -90)/.6) * 601) + (360 /.6); ok( $calc == 153855 ) or diag ("((63 - -90)/.6) * 601) + (360 /.6) = 153855 not $calc ");
This test will pass on any other CPAN Tester platform and 153855 is what I get if work this by hand.
My module will not work correctly if this code returns the wrong value. Is there any way I can modify the code to get the expected result on any version of Perl?
Another option is to detect uselongdouble in Makefile.PL and not build on the problem systems. I'd rather not do that.
Thank you for considering my problem.
In reply to test fails on 64bit uselongdouble Perl by frankcox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |