System.Number - Manhunter07/MFL GitHub Wiki
Declaration
type Number = \built-in\
Description
The Number
type in the System
package represents the a constraint for numeric values. Allowed values are any integer and fractional numbers, including the special values of NaN
and Inf
. Numbers are used for quantities, counting and mathematic calculations.
If you need a type that only accepts either positive or negative numbers, consider using Positive
and Nagative
types.
If you need a type that only accepts integers, consider using either the integer
, the rangeint
or the sizeint
type constructor.
Operator compatibility
When used uppon numeric operands, the operators +
, -
, /
, %
, and ^
return numeric values. Anything returned by them is considered a value supported by this type. The ?
regardless of its operand types returns values from within -1
to 1
and can therefore safely be used to construct the argument for a Number
-typed parameter.