Skip Menu |

This queue is for tickets about the Text-KnuthPlass CPAN distribution.

Report information
The Basics
Id: 76548
Status: resolved
Priority: 0/
Queue: Text-KnuthPlass

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.02
Fixed in: 1.04



Subject: Fails when nvsize > 8 and JSON::Syck is installed
As per subject. Sample fail report: http://www.cpantesters.org/cpan/report/20810809 If JSON::Syck is not installed, the whole test is skipped. If it is installed, one of the tests compares floating point numbers with string-equality leading to # $got->[1]{ratio} = '0.857142857142857143' # $expected->[1]{ratio} = '0.8571428571428571' on the report cited above. HTH&&Thanks&&Regards,
I've heard of that kind of precision issue when Perl is built with "long double" (128 bit, I think) floating point support. I don't know if such quad-precision floats existed back in 2012, but it's worth considering. If this is a t-test that's failing, look into use Config; if ($Config{uselongdouble}) { # code testing with longer precision } else { # code testing with standard precision }
I ran into this very same trouble with PDF::Table, when some CPAN testers started using Perls built with "long doubles" and "quadmath" packages. Since there is no standardization of results among all these floating point libraries (and even among short and long floats!), I found I had to just round troublesome values (just one in the t-tests, so far) to a small but "appropriate" number of decimal digits, and compare to that.
I fixed this particular one in 1.04, but then it failed on the NEXT long value (0.2222....222). I went ahead and fixed all three remaining long values in that test (for the 1.05 release), since surely the next one (0.3333....333) will fail next.