Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Scientific Notation Throws Off Results.

by fruiture (Curate)
on Jan 14, 2004 at 15:53 UTC ( #321279=note: print w/ replies, xml ) Need Help??


in reply to Scientific Notation Throws Off Results.

bl0rf said it: don't stringify things that you don't actually need as strings. The "number of digits" needs no stringification, it's a logarithm:

sub number_of_digits { my $number = shift; my $base = shift || 10; 1 + int( log($number) / log($base) ) }
--
http://fruiture.de


Comment on Re: Scientific Notation Throws Off Results.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-08-27 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (237 votes), past polls