Skip Menu |

This queue is for tickets about the JCAMP-DX CPAN distribution.

Report information
The Basics
Id: 131683
Status: open
Priority: 0/
Queue: JCAMP-DX

People
Owner: MERKYS [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.02
Fixed in: (no value)



Subject: Test failures because of floating point inaccuracies
On some of my smoker systems (e.g. using perls compiled with -Duselongdouble) the test suite fails: ... inputs/McDonald1988_IIa.jcamp: FAILED: @@ -48,23 +48,23 @@ 'XYDATA' => bless( { 'X' => [ 450, - '686.533333333333', - '923.066666666667', + '686.533333333333333', + '923.066666666666667', '1159.6', - '1396.13333333333', - '1632.66666666667', + '1396.13333333333333', + '1632.66666666666667', '1869.2', - '2105.73333333333', - '2342.26666666667', + '2105.73333333333333', + '2342.26666666666667', '2578.8', ... (etc, more diffs following) ...
On Tue Feb 04 16:44:04 2020, SREZIC wrote: Show quoted text
> inputs/McDonald1988_IIa.jcamp: FAILED: > @@ -48,23 +48,23 @@ > 'XYDATA' => bless( { > 'X' => [ > 450, > - '686.533333333333', > - '923.066666666667', > + '686.533333333333333', > + '923.066666666666667', > '1159.6', > - '1396.13333333333', > - '1632.66666666667', > + '1396.13333333333333', > + '1632.66666666666667', > '1869.2', > - '2105.73333333333', > - '2342.26666666667', > + '2105.73333333333333', > + '2342.26666666666667', > '2578.8', > ... (etc, more diffs following) ...
Thanks for the report. I am aware of the situation, however, I cannot find a simple way to fuzzily compare returned data with the one deserialized from a text file. Do you have an idea how to solve it?
On 2020-02-05 02:55:52, MERKYS wrote: Show quoted text
> On Tue Feb 04 16:44:04 2020, SREZIC wrote:
> > inputs/McDonald1988_IIa.jcamp: FAILED: > > @@ -48,23 +48,23 @@ > > 'XYDATA' => bless( { > > 'X' => [ > > 450, > > - '686.533333333333', > > - '923.066666666667', > > + '686.533333333333333', > > + '923.066666666666667', > > '1159.6', > > - '1396.13333333333', > > - '1632.66666666667', > > + '1396.13333333333333', > > + '1632.66666666666667', > > '1869.2', > > - '2105.73333333333', > > - '2342.26666666667', > > + '2105.73333333333333', > > + '2342.26666666666667', > > '2578.8', > > ... (etc, more diffs following) ...
> > Thanks for the report. I am aware of the situation, however, I cannot > find a simple way to fuzzily compare returned data with the one > deserialized from a text file. Do you have an idea how to solve it?
A possibility would be to use the CPAN module Test::Deep --- see https://metacpan.org/pod/Test::Deep#num for an example how to compare a deep structure with numeric values using a tolerance. Another possibility is to do a normalization step before (for example cropping some digits at the end) to both the expected and got data structures.