Approximate equality: Difference between revisions

No edit summary
Line 1,348:
rat_approx(3.14159265358979323) = 1726375805/549522486
</pre>
 
=={{header|Smalltalk}}==
There are slight differences in how this is named in the various dialects. If required, you have to add a forwarding alias method to Number.
{{works with|Smalltalk/X}}
<lang smalltalk>{ #(100000000000000.01 100000000000000.011) .
#(100.01 100.011) .
{10000000000000.001 / 10000.0 . 1000000000.0000001000} .
#(0.001 0.0010000001) .
#(0.000000000000000000000101 0.0) .
{ 2 sqrt * 2 sqrt . 2.0} .
{ 2 sqrt negated * 2 sqrt . -2.0} .
#(3.14159265358979323846 3.14159265358979324)
} pairsDo:[:val1 :val2 |
]</lang>
{{out}}
 
=={{header|Swift}}==
Anonymous user