On Thu, 28 Jul 2005 10:55:54 +0200, Dominic Dunlop <[EMAIL PROTECTED]> wrote:
> On 2005–07–28, at 00:43, Piotr Fusik (via RT) wrote: > > > > ActivePerl on Windows prints or stringifies -0.0 to "0", > > rather than the expected "-0": > > > > perl -le "print -0.0" > > 0 > > > > This is incompatible with the same version of ActivePerl on Linux. > > > This may be related to this comment in t/op/sprintf.t: > > # The following tests are not currently run, for the reasons stated: > > =pod > > =begin problematic > > >%.0f< >-0.1< >-0< >C library bug: no minus on VMS, HP-UX< Which isn't true anymore anyway. I've just tried on SuSE 9.2, SuSE 9.3, AIX 4.3.3, AIX 5.2.0, HP-UX 11i, and HP-UX 11.00, and all print "-0" on the example below. Only HP-UX 10.20 still prints "0" > ... > > Does Windows (or rather Microsoft's standard C library) have the same > issue? > > What does Windows ActivePerl say for > > $ perl -we 'printf "%0.f\n", -0.1' > -0 > > But anyway, as the C standard has a footnote saying "The results of > all floating conversions of a negative zero, and of negative values > that round to zero, include a minus sign", I've attached a patch for > sprintf.t that adds a test. I fully expect it to fail on a number of > platforms, in which case it can be hoisted into the "problematic" > section. Smokers, let me know of failures please. And, knowing that it fails on those platforms, what do you want to do with it? Skip or TODO? I can assure you that no changes will be made for libc in HP-UX 11.00 or below, so the 10.20 failure will stay there till the end of times (unless we work around it in the perl source, which is not worth the trouble if you want my opinion) -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2 on HP-UX 10.20, 11.00 & 11.11, AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org, perl QA: http://qa.perl.org reports to: [EMAIL PROTECTED], perl-qa@perl.org