|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Determining if a rational number terminatesby tobyink (Monsignor) |
| on Nov 29, 2012 at 16:27 UTC ( #1006294=note: print w/ replies, xml ) | Need Help?? |
|
Nicely obfuscated, but this is shorter:
Of course, neither of these works for the fraction 3/6 which of course terminates as 0.5. For that to work, you'd need to add an initial step to reduce the fraction to its lowest terms.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Obfuscated Code
|
|
||||||||||||||||||||||||||||||||