On Tue, 10 Aug 2004, Jarkko Hietaniemi wrote:
> $ perl -Ilib t/pmc/perlnum.t
> ...
> not ok 36 - +- zero
> # Failed test (t/pmc/perlnum.t at line 690)
> # got: '0
> # 0
> # '
> # expected: '0
> # -0.000000
> # '
> I don't think there is any guarantee how fp -0.0 should be printed
> by printf() (I could be wrong on this, as usual). Even if there is,
> unless Parrot does something about it (to fudge the result), I do not
> think a platform behaving slightly differently (like printing the
> negative zero as zero) is not a failure.
At present, I think parrot *does* try and "do something about it", but it
does so in a rather non-portable way. What I think it ought to do is use
signbit(), if available.
The hack used now depends on BIG_ENDIAN or LITTLE_ENDIAN (I think -- I
don't have sources available right now so I can't check) and probably
assumes something about sizeof(int) relative to sizeof(double). I'd
expect that the "algorithm" used there is simply wrong for IRIX64.
--
Andy Dougherty [EMAIL PROTECTED]