Created
September 21, 2016 23:48
-
-
Save bleis-tift/25967bc60c426e9260603ace083f7882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FloatEq = FloatEq of float * float | |
let (=.) a b = FloatEq (a, b) | |
let (<+->) (FloatEq (a, b)) e = abs (a - b) < e | |
10.3 =. 9.9 <+-> 0.5 // => true | |
10.3 =. 9.9 <+-> 0.1 // => false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment