Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (17)
As of 2015-07-02 17:03 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 (44 votes), past polls