Math
The Math group exposes elementary operations over PascalScript/Delphi Extended values. Most are modified PascalScript standard functions or direct Delphi Math bindings; NthRoot is a Velox helper implemented through logarithm and exponentiation.
Common tasks
- Use
Absfor magnitude andIntfor a floating-point integer part rounded toward zero. - Use
SinandCoswith angles in radians;Pisupplies the matching constant. - Use
Powerfor anExtendedbase and signed integer exponent. - Use
Sqrtfor a principal square root andNthRootonly within its documented positive-input/logarithmic domain.
Numeric model
These functions use binary floating-point. Results are approximations and can contain rounding error; they are not exact decimal currency calculations. Delphi Extended precision and storage are platform dependent, so do not make an interchange format or equality threshold depend on undocumented extra precision.
Trigonometric inputs are radians, not degrees. Convert explicitly when source data uses degrees:
Radians := Degrees * Pi / 180;
Domains and exceptional values
Square root, logarithmic nth-root construction and power operations have mathematical domains. Negative bases, zero with a negative exponent, invalid root values, overflow and underflow can raise a math exception or produce a non-finite value according to the active floating-point environment and terminal routine.
NaN and infinity do not behave like ordinary ordered numbers. Validate externally supplied values before using a result in equality, range, array-size or loop decisions. Use the Numeric group for integer bounds, rounding algorithms and pseudo-random values; those entries have different result widths and global-state behavior.
No group-wide rounding or tolerance policy is applied. Choose and document one at the integration boundary when a result will be compared, serialized or stored at fixed precision.