Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[virtualsue]: I was called upon to remove a gnawed mouse carcass from the living room this morning
holli googles dryarian just to make sure that isn't actually thing
[holli]: I mean, you never know, right?
[shmem]: good $localtime monkses
[holli]: mmh. maybe a user handle "dry arian" is a bit unfortunate? https://www. pinterest.de/ dryarian/
[Discipulus]: exists!
[shmem]: holli, agreed. "dry airan" would be slightly better :P
[holli]: virtualsue: How much was left?
[shmem]: Discipulus: oh. tatsächlich.
shmem missed his monkday yesterday :P - 12 years and way to go...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (14)
As of 2017-11-21 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (301 votes). Check out past polls.

    Notices?