in reply to Negative zero? There's gotta be a sprintf that undoes that, right?
The output is:#!/usr/bin/perl use warnings; use strict; my $nz = -0.000000000001; $nz = sprintf("%.5f",$nz); print $nz, " ", zerofy($nz), "\n"; sub zerofy { my $num = shift; if ( $num == 0.0 ) { $num = 0.0; } return $num; }
C:\Code>perl zerofy.pl -0.00000 0
|
|---|