Real Physical Quantities with Units
- Last UpdatedMar 28, 2023
- 1 minute read
Numbers can be qualified by an appended unit string. Most common are the standard MM, M/etres, IN/ches, FT. However any of the standard units supported by the system (refer to Standard Units) can be used together with most combinations of them in compound unit strings. Feet and inches can also be shown as in 10'6.
Such values are always internally converted to internal database units so that any processing, comparison etc., done with these values is always done consistently and in the same units.
Function arguments if not purely numeric must be consistent with each other and the function itself. For example trigonometric functions (SIN, COS etc.) must have arguments defined in angle units (in any at all). General functions like MIN, MAX must have all arguments which have units consistent with the same physical quantity (e.g. units of length).
Arithmetic expressions must add and subtract unit consistent quantities.
Multiplication and division will generate reals of the same physical quantity (but scaled) if only one value has units, or a real of a new physical quantities if both have. For example there is a difference between (5 * 10inch) and (5mm * 10inch) which are 50inch and 1.9685 square inches respectively.
When numbers have units that are not consistent with each other, or the function or expression they are being used then warnings, and sometimes (for serious problems) errors are raised.