Skip to main content

Scientific Notation

Scientific Notation

To specify scientific (exponential) notation in ObjectScript, use the following format:

[-]mantissaE[-]exponent 

where

Element Description
- Optional — One or more Unary Minus or Unary Plus operators. These PlusSign and MinusSign characters are configurable. Conversion to canonical form resolves these operators after resolving the scientific notation.
mantissa An integer or fractional number. May contain leading and trailing zeros and a trailing decimal separator character.
E An operator delimiting the exponent. The uppercase “E” is the standard exponent operator; the lowercase “e” is a configurable exponent operator, using the ScientificNotation() method of the %SYSTEM.ProcessOpens in a new tab class.
- Optional — A single Unary Minus or Unary Plus operator. Can be used to specify a negative exponent. These PlusSign and MinusSign characters are configurable.
exponent An integer specifying the exponent (the power of 10). Can contain leading zeros. Cannot contain a decimal separator character.

For example, to represent 10, use 1E1. To represent 2800, use 2.8E3. To represent .05, use 5E-2.

No spaces are permitted between the mantissa, the E, and the exponent. Parentheses, concatenation, and other operators are not permitted within this syntax.

Because resolving scientific notation is the first step in converting a number to canonical form, some conversion operations are not available. The mantissa and exponent must be numeric literals, they cannot be variables or arithmetic expressions. The exponent must be an integer with (at most) one plus or minus sign.

See the ScientificNotation()Opens in a new tab method of the %SYSTEM.ProcessOpens in a new tab class.

FeedbackOpens in a new tab