Algosim documentation: frac

frac

The fractional part function.

Syntax

Description

If x is a real number, then frac(x) is the fractional part of x, that is, frac(x) = x − trunc(x). frac(x) has the same sign as x, a zero as the integral part, and the same fractional digits as x.

Examples

frac(π)
0.14159265359
frac(e)
0.718281828459
frac(−π)
−0.14159265359
frac(−e)
−0.718281828459

See also