These are some of the more essential mathematical routines in Power-4gl.
Determines whether two numbers are close to each other by a factor or a difference.
4 parameters:
Value1: The first value to be
compared.
Value2: The second value to be
compared.
Difference: If the values differ by this amount or
less, then they are considered similar. This is an optional
parameter.
Factor: If the values differ by this factor or
less, then they are considered similar. This is an optional parameter.
1 return value:
Verdict: True if the values are
considered similar, otherwise false.
Returns the absolute value of a number.
1 parameters:
Value: The number to be evaluated.
1 return value:
Result: The absolute value of the
number.
Rounding of a decimal number (up or down) to a given decimal place.
2 parameters:
Value: The number to be
rounded.
Place: The decimal place to be rounded to. Zero
means rounding to an whole number. A positive value moves the decimal place to
the left, thus rounding to higher orders of magnitude. A negative value moves
the decimal place to the right.
1 return value:
Result: The rounded number.
Exponentiation, with the capability of using fractions in the exponent (the built in exponentiation operator in 4gl allows only integer exponents).
2 parameters:
Value: The number to be
exponentiated.
Exponent: The number (can be a fraction) to
use as an exponent.
1 return value:
Result: The exponentiated value.