Arithmetic Functions

This section lists Fathom's arithmetic functions.

abs( x )

Absolute value. You may also use vertical bars.
Example: abs(-1) and | -1| both give 1.

floor( x )

Next-lower integer. (Compare with trunc.)
Example: floor( -3.14 ) gives -4.

trunc( x )

Lops off the decimals. (Compare with floor.)
Example: trunc( -3.14 ) gives -3.

round( x )

Round to nearest integer.
Example: round( -3.14 ) gives -3.

sgn( x )

Gives -1 if negative, +1 if positive, and 0 if 0.
Example: sgn(-3.14 ) gives -1.

modulo( x, y)

The remainder when you divide the first number by the second.
Example: modulo(8, 3) gives 2.

exp( x )

Exponential. For example, exp(2) is e squared.

ln( x )

Logarithm to the base e (natural log). Example: ln(1) gives zero.

log( x )

Common log. Example: log(1000) gives 3.

combinations( n, k )

The number of combinations of n things taken k at a time.
Example: combinations(5, 2) gives 10.

factorial

Use the exclamation point for factorial: 4! gives 24.

sqrt( x )

Square root. This is a synonym for the radical sign ( --) for those that prefer their functions spelled out.

 

Categories of functions