Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Clean log_10 ?

by dave_the_m (Monsignor)
on Nov 28, 2019 at 19:48 UTC ( #11109390=note: print w/replies, xml ) Need Help??


in reply to Re^2: Clean log_10 ?
in thread Clean log_10 ?

Do you mean that the number you are taking the log of will always be a power of 10? In which case, the log will be almost an integer, so round to nearest int: $power = int($log10 + 0.5);

Otherwise, why not use sprintf "%e", $num or similar?

Dave.

Replies are listed 'Best First'.
Re^4: Clean log_10 ?
by LanX (Cardinal) on Nov 28, 2019 at 20:17 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2020-10-24 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (246 votes). Check out past polls.

    Notices?