Skip Menu |

This queue is for tickets about the JSON-PP CPAN distribution.

Report information
The Basics
Id: 124331
Status: rejected
Priority: 0/
Queue: JSON-PP

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

Bug Information
Severity: Unimportant
Broken in: 2.27203
Fixed in: (no value)



Subject: Formatting error of exponent part on Win32 host -- superfluous leading "0"
On a Win32 host, when JSONified floating-point values are represented in scientific notation, the exponent part can have a superfluous leading "0". I do not have access to a Win32 testing environment myself, so I am unable to attempt reproduction; the formatting error was observed in a Win32 CPANtesters report: https://www.cpantesters.org/cpan/report/5e1628dc-6bf3-1014-8976-93ea4c2286d7 .. archived here: http://ciar.org/h/1cae9e.html The report indicates JSON::PP version 2.27203. Details as manifested in failed unit test: # Failed test 'default parameters' # at t/03-init-parameters.t line 11. # got: '[["k",2.5,1e-007],["a",0.5,1e-007],["b",0.5,1e-007],["c",0.5,1e-007]]' # expected: '[["k",2.5,1e-07],["a",0.5,1e-07],["b",0.5,1e-07],["c",0.5,1e-07]]' On a tangental note, I will be re-implementing these tests to use is_deeply instead of comparing JSON strings.
On Tue Feb 06 07:53:50 2018, TTKCIAR wrote: Show quoted text
> On a Win32 host, when JSONified floating-point values are represented > in scientific notation, the exponent part can have a superfluous > leading "0". > > I do not have access to a Win32 testing environment myself, so I am > unable to attempt reproduction; the formatting error was observed in a > Win32 CPANtesters report: > > https://www.cpantesters.org/cpan/report/5e1628dc-6bf3-1014-8976- > 93ea4c2286d7 > > .. archived here: > http://ciar.org/h/1cae9e.html > > The report indicates JSON::PP version 2.27203. > > Details as manifested in failed unit test: > > # Failed test 'default parameters' > # at t/03-init-parameters.t line 11. > # got: '[["k",2.5,1e-007],["a",0.5,1e-007],["b",0.5,1e- > 007],["c",0.5,1e-007]]' > # expected: '[["k",2.5,1e-07],["a",0.5,1e-07],["b",0.5,1e- > 07],["c",0.5,1e-07]]' > > On a tangental note, I will be re-implementing these tests to use > is_deeply instead of comparing JSON strings.
Thanks for the report, but this is not a JSON::PP issue but a perl's portability issue, that means perl -E "say q{0.0000001} + 0" always prints 1e-007 under Win32 (strawberry perl/ActivePerl), instead of 1e-07. If you do think this is a real problem, please report it to p5p. However, it is not reliable to compare two stringified small floating values from the start, and Algorithm::CurveFit::Simple 1.02 passes all its tests under Win32. So I assume this is not a real issue for you anymore. I close this as wontfix now.