Portability | portable |
---|---|
Stability | experimental |
Maintainer | github.com/justinethier |
Safe Haskell | Safe-Inferred |
This module implements the numerical tower.
- numSub :: [LispVal] -> ThrowsError LispVal
- numMul :: [LispVal] -> ThrowsError LispVal
- numDiv :: [LispVal] -> ThrowsError LispVal
- numAdd :: [LispVal] -> ThrowsError LispVal
- numMod :: [LispVal] -> ThrowsError LispVal
- numRationalize :: [LispVal] -> ThrowsError LispVal
- numBoolBinopEq :: [LispVal] -> ThrowsError LispVal
- numBoolBinopGt :: [LispVal] -> ThrowsError LispVal
- numBoolBinopGte :: [LispVal] -> ThrowsError LispVal
- numBoolBinopLt :: [LispVal] -> ThrowsError LispVal
- numBoolBinopLte :: [LispVal] -> ThrowsError LispVal
- numCast :: [LispVal] -> ThrowsError LispVal
- numDenominator :: [LispVal] -> ThrowsError LispVal
- numNumerator :: [LispVal] -> ThrowsError LispVal
- numInexact2Exact :: [LispVal] -> ThrowsError LispVal
- numExact2Inexact :: [LispVal] -> ThrowsError LispVal
- num2String :: [LispVal] -> ThrowsError LispVal
- unpackNum :: LispVal -> ThrowsError Integer
- numericBinop :: (Integer -> Integer -> Integer) -> [LispVal] -> ThrowsError LispVal
- numFloor :: [LispVal] -> ThrowsError LispVal
- numCeiling :: [LispVal] -> ThrowsError LispVal
- numTruncate :: [LispVal] -> ThrowsError LispVal
- numRound :: [LispVal] -> ThrowsError LispVal
- numExpt :: [LispVal] -> ThrowsError LispVal
- numSqrt :: [LispVal] -> ThrowsError LispVal
- numExp :: [LispVal] -> ThrowsError LispVal
- numLog :: [LispVal] -> ThrowsError LispVal
- numSin :: [LispVal] -> ThrowsError LispVal
- numCos :: [LispVal] -> ThrowsError LispVal
- numTan :: [LispVal] -> ThrowsError LispVal
- numAsin :: [LispVal] -> ThrowsError LispVal
- numAcos :: [LispVal] -> ThrowsError LispVal
- numAtan :: [LispVal] -> ThrowsError LispVal
- buildComplex :: LispVal -> LispVal -> ThrowsError LispVal
- numMakePolar :: [LispVal] -> ThrowsError LispVal
- numRealPart :: [LispVal] -> ThrowsError LispVal
- numImagPart :: [LispVal] -> ThrowsError LispVal
- numMagnitude :: [LispVal] -> ThrowsError LispVal
- numAngle :: [LispVal] -> ThrowsError LispVal
- numMakeRectangular :: [LispVal] -> ThrowsError LispVal
- isComplex :: [LispVal] -> ThrowsError LispVal
- isReal :: [LispVal] -> ThrowsError LispVal
- isRational :: [LispVal] -> ThrowsError LispVal
- isInteger :: [LispVal] -> ThrowsError LispVal
- isNumber :: [LispVal] -> ThrowsError LispVal
- isFloatAnInteger :: LispVal -> Bool
- isNumNaN :: [LispVal] -> ThrowsError LispVal
- isNumInfinite :: [LispVal] -> ThrowsError LispVal
- isNumFinite :: [LispVal] -> ThrowsError LispVal
- isNumExact :: [LispVal] -> ThrowsError LispVal
- isNumInexact :: [LispVal] -> ThrowsError LispVal
Generic functions
numSub :: [LispVal] -> ThrowsError LispValSource
Subtract the given numbers
numMul :: [LispVal] -> ThrowsError LispValSource
Multiply the given numbers
numDiv :: [LispVal] -> ThrowsError LispValSource
Divide the given numbers
numAdd :: [LispVal] -> ThrowsError LispValSource
Add the given numbers
numMod :: [LispVal] -> ThrowsError LispValSource
Take the modulus of the given numbers
numRationalize :: [LispVal] -> ThrowsError LispValSource
Convert the given number to a rational
numBoolBinopEq :: [LispVal] -> ThrowsError LispValSource
Numeric equals
numBoolBinopGt :: [LispVal] -> ThrowsError LispValSource
Numeric greater than
numBoolBinopGte :: [LispVal] -> ThrowsError LispValSource
Numeric greater than equal
numBoolBinopLt :: [LispVal] -> ThrowsError LispValSource
Numeric less than
numBoolBinopLte :: [LispVal] -> ThrowsError LispValSource
Numeric less than equal
numCast :: [LispVal] -> ThrowsError LispValSource
Accept two numbers and cast one of them to the appropriate type, if necessary
numDenominator :: [LispVal] -> ThrowsError LispValSource
Take the denominator of the given number
numNumerator :: [LispVal] -> ThrowsError LispValSource
Take the numerator of the given number
numInexact2Exact :: [LispVal] -> ThrowsError LispValSource
Convert an inexact number to exact
numExact2Inexact :: [LispVal] -> ThrowsError LispValSource
Convert an exact number to inexact
num2String :: [LispVal] -> ThrowsError LispValSource
Convert a number to a string; radix is optional, defaults to base 10
unpackNum :: LispVal -> ThrowsError IntegerSource
Extract an integer from the given value, throwing a type error if the wrong type is passed.
numericBinop :: (Integer -> Integer -> Integer) -> [LispVal] -> ThrowsError LispValSource
A helper function to perform a numeric operation on two values
Floating point functions
numFloor :: [LispVal] -> ThrowsError LispValSource
Floor the given number
numCeiling :: [LispVal] -> ThrowsError LispValSource
Take the ceiling of the given number
numTruncate :: [LispVal] -> ThrowsError LispValSource
Truncate the given number
numRound :: [LispVal] -> ThrowsError LispValSource
Round the given number
numExpt :: [LispVal] -> ThrowsError LispValSource
Raise the first number to the power of the second
numSqrt :: [LispVal] -> ThrowsError LispValSource
Take the square root of the given number
numExp :: [LispVal] -> ThrowsError LispValSource
Take the exponent of the given number
numLog :: [LispVal] -> ThrowsError LispValSource
Compute the log of a given number
Trigonometric functions
numSin :: [LispVal] -> ThrowsError LispValSource
Sine
numCos :: [LispVal] -> ThrowsError LispValSource
Cosine
numTan :: [LispVal] -> ThrowsError LispValSource
Tangent
numAsin :: [LispVal] -> ThrowsError LispValSource
Arcsine
numAcos :: [LispVal] -> ThrowsError LispValSource
Arccosine
numAtan :: [LispVal] -> ThrowsError LispValSource
Arctangent
Complex functions
:: LispVal | Real part |
-> LispVal | Imaginary part |
-> ThrowsError LispVal | Complex number |
Create a complex number
numMakePolar :: [LispVal] -> ThrowsError LispValSource
Create a complex number from its magnitude and phase (angle)
numRealPart :: [LispVal] -> ThrowsError LispValSource
Retrieve real part of a complex number
numImagPart :: [LispVal] -> ThrowsError LispValSource
Retrieve imaginary part of a complex number
numMagnitude :: [LispVal] -> ThrowsError LispValSource
The nonnegative magnitude of a complex number
numAngle :: [LispVal] -> ThrowsError LispValSource
The phase of a complex number
numMakeRectangular :: [LispVal] -> ThrowsError LispValSource
Create a complex number given its real and imaginary parts
Predicates
isComplex :: [LispVal] -> ThrowsError LispValSource
Predicate to determine if given number is complex. Keep in mind this does not just look at the types
isReal :: [LispVal] -> ThrowsError LispValSource
Predicate to determine if given number is a real. Keep in mind this does not just look at the types
isRational :: [LispVal] -> ThrowsError LispValSource
Predicate to determine if given number is a rational. Keep in mind this does not just look at the types
isInteger :: [LispVal] -> ThrowsError LispValSource
Predicate to determine if given number is an integer. Keep in mind this does not just look at the types; a floating point input value can return true, for example.
isNumber :: [LispVal] -> ThrowsError LispValSource
Predicate to determine if given value is a number
isFloatAnInteger :: LispVal -> BoolSource
A utility function to determine if given value is a floating point number representing an whole number (integer).
isNumNaN :: [LispVal] -> ThrowsError LispValSource
isNumInfinite :: [LispVal] -> ThrowsError LispValSource
isNumFinite :: [LispVal] -> ThrowsError LispValSource
isNumExact :: [LispVal] -> ThrowsError LispValSource
isNumInexact :: [LispVal] -> ThrowsError LispValSource