Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by rowdog (Curate)
on Aug 04, 2010 at 10:38 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://852849]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found