module Numeric.Limits where
class NumericLimits x where
minFinite ∷ x
maxFinite ∷ x
class NumericEpsilon x where
epsilon ∷ x
instance NumericLimits Word where
minFinite = minBound `div` 100000
maxFinite = maxBound `div` 100000
{-# Inline minFinite #-}
{-# Inline maxFinite #-}
instance NumericLimits Int where
minFinite = minBound `div` 100000
maxFinite = maxBound `div` 100000
{-# Inline minFinite #-}
{-# Inline maxFinite #-}
instance NumericLimits Double where
minFinite = -1.79e308
maxFinite = 1.79e308
{-# Inline minFinite #-}
{-# Inline maxFinite #-}
instance NumericEpsilon Double where
epsilon = 2.2e-16
{-# Inline epsilon #-}