Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Determining if a rational number terminates

by herveus (Parson)
on Nov 29, 2012 at 19:14 UTC ( #1006338=note: print w/replies, xml ) Need Help??


in reply to Determining if a rational number terminates

Howdy!

What you really mean is "does this rational number's decimal expansion have a form that ends with zeros?". 1/10 has two forms: 0.1000000000... and 0.099999999999... They are equal.

yours,
Michael
  • Comment on Re: Determining if a rational number terminates

Replies are listed 'Best First'.
Re^2: Determining if a rational number terminates
by tobyink (Abbot) on Nov 29, 2012 at 20:14 UTC

    They are equal, but one is generally recognised as the more canonical representation.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006338]
help
Chatterbox?
[choroba]: I already gave a similar talk to my friends in a pub and at an internal conference at work and people liked it, so maybe...
[choroba]: LanX: That's the heritage, I can't do anything else
[RonW]: Sounds like some system my employer has "It does exactly what we need it to do and can't afford to risk anything we can't prove is 100% compatible"
[marto]: choroba sounds interesting
[RonW]: james28909 Why not write a Perl program to do the task?
[choroba]: RonW Yes, but then, one day, they needed to switch from FTP to SFTP, and... but I can't give the whole talk away here :)
[RonW]: Tunnel FTP through stunnel?

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2017-05-22 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?