OScript API/Built-in Package Index

Class: Real

A Real is a double-precision floating point number, and can therefore take on any positive or negative value in the range of 1.0E-308 to 1.0E307, with fifteen digit precision. Real values can be obtained by:

  • declaring a Real variable (default value of 0)
  • using a Real literal, expressed using a decimal point (for example, 234.5678) or scientific notation (for example 2.345678E2)
  • evaluating an expression that results in a Real value (for example, 345.29 * 36)
  • executing a function that returns a Real value (for example, the Math.Power() function)

Real expressions are created by joining two or more numbers, at least one of which is a Real (the others can be Integers), using the arithmetic operators to form an expression whose result is another Real.

The following example illustrates:

    Integer dollars = 2000
    Real taxPercentage = .33
    Real grossPay = dollars * ( 1 - taxPercentage )

Arithmetic expressions can be created containing a mixture of Reals and Integers. When this is done, Integer math operations are performed until a Real is encountered. From this point on, Real math operations are performed.

 Copyright © 2022 OpenText Corporation. All rights reserved.