logfloat-0.8.3: Log-domain floating point numbersSource codeContentsIndex
Documentation Note
IEEE floating-point special values
Basic functions
LogFloat data type and conversion functions



infinity :: Fractional a => a
negativeInfinity :: Fractional a => a
notANumber :: Fractional a => a
log :: Floating a => a -> a
data LogFloat
logFloat :: Real a => a -> LogFloat
logToLogFloat :: Real a => a -> LogFloat
fromLogFloat :: Floating a => LogFloat -> a
logFromLogFloat :: Floating a => LogFloat -> a
Documentation Note
If you see no module description above, then the lhs2hs script was not run correctly. Please rebuild the documentation or see: http://code.haskell.org/~wren/logfloat/dist/doc/html/logfloat/
IEEE floating-point special values

GHC.Real defines infinity and notANumber as Rational. We export variants which are polymorphic because that can be more helpful at times.

BUG: At present these constants are broken for Ratio types including Rational, since Ratio types do not typically permit a zero denominator. In GHC (6.8.2) the result for infinity is a rational with a numerator sufficiently large that fromRational will yield infinity for Float and Double. In Hugs (September 2006) it yields an arithmetic overflow error. For GHC, our notANumber yields 0%1 rather than 0%0 as GHC.Real does.

infinity :: Fractional a => aSource
negativeInfinity :: Fractional a => aSource
notANumber :: Fractional a => aSource
Basic functions
log :: Floating a => a -> aSource

Since the normal log throws an error on zero, we have to redefine it in order for things to work right. Arguing from limits it's obvious that log 0 == negativeInfinity.

If you're using some Floating type that's not built in, verify this equation holds for your 0 and negativeInfinity. If it doesn't, then you should avoid importing our log and will probably want converters to handle the discrepency.

LogFloat data type and conversion functions
data LogFloat Source




show/hide Instances
logFloat :: Real a => a -> LogFloatSource
logToLogFloat :: Real a => a -> LogFloatSource
fromLogFloat :: Floating a => LogFloat -> aSource
logFromLogFloat :: Floating a => LogFloat -> aSource
Return the log-domain value itself without costly conversion
Produced by Haddock version 2.4.2