Arithmetic/Rational: Difference between revisions
Added Quackery.
m (→{{header|Phix}}: added syntax colouring the hard way) |
(Added Quackery.) |
||
Line 3,764:
def __int__(self):
return (self.numerator // self.denominator)</lang>
=={{header|Quackery}}==
Quackery comes with a rational arithmetic library, <code>bigrat.qky</code>, documented in '''The Book of Quackery.pdf''', both available at [https://github.com/GordonCharlton/Quackery the Quackery Github repository].
<code>factors</code> is defined at [[Factors of an integer#Quackery]].
<lang Quackery> [ $ "bigrat.qky" loadfile ] now!
[ -2 n->v rot
factors witheach
[ n->v 1/v v+ ]
v0= ] is perfect ( n -> b )
19 bit times [ i^ perfect if [ i^ echo cr ] ]</lang>
{{out}}
<pre>6
28
496
8128
</pre>
=={{header|Racket}}==
|