develooper Front page | perl.perl5.porters | Postings from January 2018

Re: [perl #132775] Blead Breaks CPAN:SMUELLER/Math-Clipper-1.23.tar.gz

Thread Previous | Thread Next
From:
Zefram
Date:
January 28, 2018 13:42
Subject:
Re: [perl #132775] Blead Breaks CPAN:SMUELLER/Math-Clipper-1.23.tar.gz
Message ID:
20180128134229.GH22873@fysh.org
slaven@rezic.de wrote:
>#   Failed test 'rounding'
>#   at t/008integerize.t line 208.

It's failing due to the new correct output for sprintf("%.0f", -0.0).
It is only the test that is erroneous.  The processing in that file uses
the module's integerize_coordinate_sets() sub to round a -0.4 value,
for which it gets the entirely reasonable result of -0.0.  It compares
this against an expected result of 0 (implemented as an integer zero)
by applying sprintf("%.0f", $_) to both and string-comparing the results.

There are two possible fixes for the test.  One is to change the value
in its expected-result data structure to a negative zero.  That would
have the effect of testing that the sub under test produces the negative
zero where expected.  The other option is to alter the way values are
canonicalised for comparison to drop the sign from zeroes.  That would
have the effect of ignoring the sign of zero.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About