Arithmetic/Rational: Difference between revisions
Content added Content deleted
Line 4,209: | Line 4,209: | ||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
Smalltalk uses ''naturally'' and transparently fractions (through the class Fraction): |
Smalltalk uses ''naturally'' and transparently infinite precision fractions (through the class Fraction): |
||
<pre>st> 54/7 |
<pre>st> 54/7 |
||
54/7 |
54/7 |
||
Line 4,223: | Line 4,223: | ||
0.8333333333333334 |
0.8333333333333334 |
||
</pre> |
</pre> |
||
{{works with|GNU Smalltalk}} |
{{works with|GNU Smalltalk}} (and all others) |
||
<lang smalltalk>| sum | |
<lang smalltalk>| sum | |
||
2 to: (2 raisedTo: 19) do: [ :candidate | |
2 to: (2 raisedTo: 19) do: [ :candidate | |