Equinox Online Help - Language Reference - A to Z

Home

Abs

Applies to
SyntaxAbs(NumberExpression)
Action[Function] Returns a positive number.
ScopeUsable anywhere.
Notes

The Abs function returns the modulus of NumberExpression. eg Values of 3 and -3 for NumberExpression will both return 3

CategoryMaths
See Also Acos, Asin, Atan, Cos, Deg, Int, Log, Max, Min, MinMax, Rad, Rnd, RndStart, Round, Sign, Sin, Sqrt, Tan
Example

The following example checks a test result to see if it is wildly inaccurate. If so, it is omitted from the sample. The variable MaxError is used to test the result. MaxError is a positive number, but the difference (result - forecast) may be negative. The Abs function is therefore used, to ensure that the difference is positive.

| avoid including inaccurate test results

if Abs(result - forecast) <= MaxError then
SampleCount += 1
end if