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

log() and int() problem

by Anonymous Monk
on Dec 25, 2012 at 16:47 UTC ( #1010275=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $x = 125;
    my $l = log($x) / log(5);
    
    ...
    print "int(LOG) == ", int($l), "\n";
    
    print "Are equal: ", ($l == int($l)) ? "true\n" : "false\n";
    
  2. or download this
    LOG      == 3
    int(LOG) == 3
    Are equal: false
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1010275]
Approved by toolic
Front-paged by LanX
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-12-18 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (44 votes), past polls