Approximate equality: Difference between revisions

No edit summary
Line 411:
f~ ( r1 r2 r3 – flag ) float-ext “f-proximate”
ANS Forth medley for comparing r1 and r2 for equality: r3>0: f~abs; r3=0: bitwise comparison; r3<0:
<lang forth>
1e-18 fconstant cepsilon
: test-f~ ( f1 f2 -- )
1e-18 \ epsilon
Line 431 ⟶ 429:
3.14159265358979323846e 3.14159265358979324e test-f~ True
</pre>
 
=={{header|Fortran}}==
Compare against the Python function documented at https://www.python.org/dev/peps/pep-0485/#proposed-implementation,
Anonymous user