-- | IEE754 constants (c.f. Numeric.MathFunctions.Constants)
module Music.Theory.Math.Constant where

-- | The smallest 'Double' n such that 1 + n /= 1.
epsilonValue :: Double
epsilonValue :: Double
epsilonValue =
  let (Integer
signif, Int
expo) = forall a. RealFloat a => a -> (Integer, Int)
decodeFloat (Double
1.0 :: Double)
  in forall a. RealFloat a => Integer -> Int -> a
encodeFloat (Integer
signif forall a. Num a => a -> a -> a
+ Integer
1) Int
expo forall a. Num a => a -> a -> a
- Double
1.0

-- | Largest representable finite value.
largestFiniteValue :: Double
largestFiniteValue :: Double
largestFiniteValue = Double
1.7976931348623157e308

-- | The smallest representable positive normalized value.
smallestNormalizedValue :: Double
smallestNormalizedValue :: Double
smallestNormalizedValue = Double
2.2250738585072014e-308