module Data.ZoomCache.Numeric.FloatMinMax
( floatMin
, floatMaxDenorm
, floatMinNorm
, floatMax
)
where
import Control.Applicative
import Data.Function
floatMin :: RealFloat a => a
floatMin = fix $ do d <- floatDigits
(e,_) <- floatRange
pure $ encodeFloat 1 (ed)
floatMaxDenorm :: RealFloat a => a
floatMaxDenorm = floatMinNorm floatMin
floatMinNorm :: RealFloat a => a
floatMinNorm = fix $ do (e,_) <- floatRange
pure $ encodeFloat 1 (e1)
floatMax :: RealFloat a => a
floatMax = fix $ do r <- floatRadix
d <- floatDigits
(_,e) <- floatRange
pure $ encodeFloat (r^d1) (ed)