Capabilities
predicates
Predicates are functions that ask "yes or no" questions of their argument[s]. You can ask of a number "Is this zero?" or "Is this one?" and these predicates (iszero, isone) will work as expected with almost all numerical types. The built-in numerical types let you query finiteness (isfinite, isinf).
These are the predicates made available for use with DoubleFloats:
iszero, isnonzero, isone # value == 0, value != 0, value == 1
ispositive, isnegative, # value > 0, value < 0
isnonnegative, isnonpositive, # value >= 0, value <= 0
isinteger, isfractional, # value == round(value)
issubnormal, # zero(T) < abs(value) < floatmin(T)
isnormal, # !isinf(value) && !isnan(value) && !issubnormal(value)
isfinite, isinf, # abs(value) != Inf, abs(value) == Inf
isposinf, isneginf, # value == Inf, value == -Inf
isnan # value is not a number (eg 0/0)the basic arithmetic operations
- addition, subtraction
- multiplication, square, cube
- reciprocation, division, square root, cube root
There are arithmetic operations that take two Float64s or Float32s or Float16s and return the corresponding Double64 or Double32 or Double16. These operations are available in functional form as add2, sub2, mul2, div2 and in infix form using "⊕ ⊖ ⊗ ⊘" ( \oplus \ominus \otimes \oslash).
rounding
RoundNearest,RoundUp,RoundDownRoundToZero,RoundFromZerospread– the nearest integer to x, away from zero; spread complementstrunc.tld(x,y) = trunc(x/y)sld(x,y) = spread(s/y)
elementary mathematical functions
log,expsin,cos,tan,csc,sec,cotasin,acos,atan,acsc,asec,acotsinh,cosh,tanh,csch,sech,cothasinh,acosh,atanh,acsch,asech,acoth
linear algebra
isdiag,ishermitian,isposdef,issymmetric,istril,istriunorm,det,dot,tr,condskeel,logdet,logabsdettranspose,adjoint,tril,triudiag,diagindfactorize,lu,lufact,qr,qrfact
also
- random values in [0,1)