in reply to Negative zero? There's gotta be a sprintf that undoes that, right?
Note: Untested....my $sign = ""; if ($example < 0) { $example = -$example; $sign = "-"; } $tret = sprintf("rounded float: %s%7.5f", $sign, $example);
...roboticus
Update: I thought about it some more. It'll still have the same problem. If you were to use this approach, you'd also need an if statement that would clear the sign if the value is less than the smallest value represented as a nonzero number.
Clearly not worth the effort.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Negative zero? There's gotta be a sprintf that undoes that, right?
by rgiskard (Hermit) on Dec 11, 2007 at 18:53 UTC | |
by roboticus (Chancellor) on Dec 11, 2007 at 18:57 UTC | |
by rgiskard (Hermit) on Dec 11, 2007 at 20:14 UTC | |
by roboticus (Chancellor) on Dec 11, 2007 at 20:22 UTC | |
by suaveant (Parson) on Dec 12, 2007 at 14:14 UTC |