![]() |
Common Math Functions |
For transcendental functions like sin()
,
cos()
, exp()
, and log()
,
Sheerpower temporarily converts its internal REAL number to
a standard DOUBLE
, performs the operation, and then
converts the result back to a REAL. This is acceptable
because the results of these functions are irrational and cannot be
represented exactly by any finite-precision data type.
For all other math operations, Sheerpower maintains its high-precision REAL data type throughout the calculation, ensuring maximum numeric accuracy wherever mathematically possible.
ABS() returns the absolute value of a number.
DIV0() divides two numbers and returns 0 if the divisor is 0.
FP() returns the fractional part of a number.
MOD() returns the remainder of one number divided by another.
REMAINDER() returns the remainder of a division operation.
SIN() returns the sine of an angle.
COS() returns the cosine of an angle.
TAN() returns the tangent of an angle.
ASIN() returns the arcsine of a number.
ACOS() returns the arccosine of a number.
ATAN() returns the arctangent of a number.
ATN() also returns the arctangent of a number.
ANGLE() returns the angle from (0,0) to (x,y) in radians.
CEIL() returns the smallest integer greater than or equal to a number.
FLOOR() returns the largest integer less than or equal to a number.
INT() returns the whole portion of a REAL number as a REAL.
INTEGER() converts a numeric expression to an integer.
IP() truncates the decimal portion of a number.
ROUND() rounds a number to a specified number of decimal places.
TRUNCATE() cuts off digits after a specified decimal place.
RND() generates a random number.
rnd()
function returns a
fraction between 0 and 1 when used without parameters. If a numeric
argument is provided, it returns a whole number between 1 and that
number. Use set seed NN
to specify a repeatable
sequence.
REAL() converts a numeric expression to a REAL value.
EXP() returns e raised to the power of a number.
LOG() returns the natural logarithm (base e) of a number.
MIN() returns the smaller of two values.
MAX() returns the larger of two values.
CLAMP() restricts a value to a given range.
Sheerpower provides a wide range of additional built-in math functions. Most operate directly on its REAL data type to preserve precision throughout. For a complete reference, see the documentation here.
Hide Description
|
|
Enter or modify the code below, and then click on RUN |
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |