On Fri Mar 21 14:15:42 2014, BJOERN wrote:
Show quoted text> The release was intended to address that, but I see my simple approach
> was insufficient (the module only copies the NVs into the output, the
> output is not from floating point calculations, so these are just
> serialisation differences). I have now used Test::Deep for it. Thank
> you.
(see issue at the end of this -- it's not serialization, it is that you have assumed NV to be a IEEE 754 double and truncate for you).
The good news is that the test passes with long double Perl.
The bad news is that with a tolerance of 1 it is ignoring the values. I think you could use something like:
my $tol = 1e-15;
... num(9.46394038692233e-008, $tol) ... num(3.66040410426649e-007, $tol) ...
etc.
That way you do test that you're getting the right numbers, but only using the first part. As it is now, it will accept any of your points as matching (because they're all within 1 of each other).
I also would recommend using the same values in the comparison. That is, you enter:
9.4639403869223315e-08
as the first point, but then compare vs.
9.46394038692233e-008
which are *different* numbers. They are equal with IEEE 754 doubles, but not when NVs are something else. I think this is the root of the problem, not "serialization".