Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Stringification of FP numbers.

by syphilis (Archbishop)
on Jun 12, 2009 at 23:58 UTC ( [id://771139]=note: print w/replies, xml ) Need Help??


in reply to Stringification of FP numbers.

This would make sense if "100000.0" was printed as 1e05

Yes - I, too, would prefer to see the same rule applied to both leading and trailing zeroes. Unfortunately, that's not the way it's being done. Another way of avoiding the scientific notation (no matter how many leading zeroes) is to convert to a Math::BigFloat object:
perl -MMath::BigFloat -wle "print Math::BigFloat->new(1e-10)"
(Replace double quotes with single quotes on nix.)

Cheers,
Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://771139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-25 15:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found