metabrush/src/lib/Math/Epsilon.hs

13 lines
330 B
Haskell
Raw Normal View History

2020-08-19 03:28:47 +00:00
{-# LANGUAGE ScopedTypeVariables #-}
module Math.Epsilon
( epsilon )
where
--------------------------------------------------------------------------------
{-# SPECIALISE epsilon :: Float #-}
{-# SPECIALISE epsilon :: Double #-}
epsilon :: forall r. RealFloat r => r
epsilon = encodeFloat 1 ( 5 - floatDigits ( 0 :: r ) )