in reply to Negative zero from a multiplication by a zero?

Two more examples, from ActiveState 5.8.2 build 808 and Strawberry 5.10.0.5, with identical output from both versions (note slightly greater precision used in  printf statement, and no negative zeros):
>perl -wMstrict -le "for (-2.0,-1.9,-1.5,-1.1,-1.0,-0.9,-0.5,-0.1,-0) { my $v = $_ * 0; printf(qq{%5s -> %2s,%32.24e\n},$_,$v,$v); } " -2 -> 0, 0.000000000000000000000000e+000 -1.9 -> 0, 0.000000000000000000000000e+000 -1.5 -> 0, 0.000000000000000000000000e+000 -1.1 -> 0, 0.000000000000000000000000e+000 -1 -> 0, 0.000000000000000000000000e+000 -0.9 -> 0, 0.000000000000000000000000e+000 -0.5 -> 0, 0.000000000000000000000000e+000 -0.1 -> 0, 0.000000000000000000000000e+000 0 -> 0, 0.000000000000000000000000e+000

Replies are listed 'Best First'.
Re^2: Negative zero from a multiplication by a zero?
by ikegami (Patriarch) on Jun 09, 2009 at 16:55 UTC
    Not all machines and libraries support negative zeroes. Perl lets the underlying layers handle this, so the results won't be the same on all machines.
      I think all the posts here are on the same track...HUGE negative or positive values can yield unpredictable results.
        eh? The results are predictable and intentional (on a platform with support for negative zeroes), and they exist to support small values.