Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: how to make perl only print whole numbers

by rowdog (Curate)
on Aug 04, 2010 at 10:38 UTC ( #852849=note: print w/ replies, xml ) Need Help??


in reply to Re: how to make perl only print whole numbers
in thread how to make perl only print whole numbers

Update: nevermind, sigh.

Just to be boldly pedantic...

You can divide every number by 2 (or by any number other than zero or one), you just won't always get an integer result.


Comment on Re^2: how to make perl only print whole numbers
Replies are listed 'Best First'.
Re^3: how to make perl only print whole numbers
by SuicideJunkie (Vicar) on Aug 04, 2010 at 13:43 UTC

    Every number includes 1.5, and 1.5 / 1 does not give an integer result.

    The OP code even allows you to enter such numbers, since the input has no validation at all.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2015-07-31 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls