Approximate equality: Difference between revisions

Line 1,350:
 
=={{header|Smalltalk}}==
This compares numbers given the number of ULPs by which they may differ (see wikipedia).
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) .
Line 1,362 ⟶ 1,363:
} pairsDo:[:val1 :val2 |
]</lang>
In CUIS, this method is called <tt>isWithin:nULPS floatsFrom:</tt>.
{{out}}
 
=={{header|Swift}}==
Anonymous user