/ Published in: Haskell
This module provides a couple of functions and an operator to compare approximately fractional numbers.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
module Circa ( circaEq, picoEq, nanoEq, microEq, milliEq, centiEq, deciEq, uniEq, (~=) ) where picoEq = circaEq 1e-12 infix 4 `picoEq` nanoEq = circaEq 1e-9 infix 4 `nanoEq` microEq = circaEq 1e-6 infix 4 `microEq` milliEq = circaEq 1e-3 infix 4 `milliEq` centiEq = circaEq 1e-2 infix 4 `centiEq` deciEq = circaEq 1e-1 infix 4 `deciEq` uniEq = circaEq 1 infix 4 `uniEq` (~=) = picoEq infix 4 ~=