Siebel eScript Language Reference > About Siebel eScript > About Data Types and Numbers >

About Numbers


This topic describes the types of numbers that you can use with Siebel eScript. Siebel eScript treats a number that contains a character other than a decimal point as a string. For example, the number 100,000 is a string, including the comma. The exception is hexadecimal numbers and scientific notation.

The number types that this topic describes are not data types. You cannot write code that uses one of these number types as a data type in the declaration of a strongly typed variable. For more information, see Using Strongly Typed and Typeless Variables.

Integer Numbers

An integer number is a positive whole number, a negative whole number, or zero. Siebel eScript recognizes the following:

  • An integer constant or an integer literal in decimal, hexadecimal, or octal notation.
  • A decimal constant or a decimal literal in decimal representation.

You cannot write code that strongly types a variable as an integer. You can write code that uses the float primitive or the value of the float primitive as an integer. For more information, see Using Strongly Typed and Typeless Variables.

Hexadecimal Numbers

A hexadecimal number is a number that uses base 16 digits. It uses digits from the following sets:

  • 0 through 9
  • A through F
  • a through f

The following format precedes a hexadecimal number:

0x

A hexadecimal number is not case-sensitive in Siebel eScript.

Table 6 lists example hexadecimal numbers and their decimal equivalents.

Table 6. Example Hexadecimal Numbers and Their Decimal Equivalents
Hexadecimal Number
Decimal Number

0x1

1

0x01

1

0x100

256

0x1F

31

0x1f

31

0xABCD

43981

var a = 0x1b2E

var a = 6958

Octal Numbers

An octal number is a number that uses base 8 digits. It includes digits from the following set:

0 through 7

A zero precedes an octal number.

Table 7 lists example octal numbers and their decimal equivalents.

Table 7. Example Octal Numbers and Their Decimal Equivalents
Octal Number
Decimal Number

00

0

05

5

077

63

var a = 0143

var a = 99

Floating Point Numbers

A floating-point number is a number that includes a whole part and a fractional part. A decimal separates these parts. For example, 10.33. Some developers refer to a floating-point number as a float. The float data type is not a floating-point number. For more information, see Float Data Type.

For more information, see Preventing a Floating-Point Error.

Floating Decimal Numbers

A floating decimal number is a number that uses the same digits as a decimal integer but uses a period to indicate the fractional part of the number. For example:

0.32, 1.44, 99.44
var a = 100.55 + .45;

Scientific Numbers

A scientific number is a number that uses decimal digits and exponential notation. The following items represent exponential notation:

  • e
  • E

A scientific number is useful if you must use very large or very small numbers. Scientific notation is also known as exponential notation.

Table 8 lists example scientific numbers and their decimal equivalents.

Table 8. Example Scientific Numbers and Their Decimal Equivalents
Scientific Number
Decimal Number

4.087e2

408.7

4.087E2

408.7

4.087e+2

408.7

4.087E-2

0.04087

var a = 5.321e31 + 9.333e-2

var a = 53210000000000000000000000000000 + 0.09333

NaN Numbers

NaN is a value that is an abbreviation for the following phrase:

not a number

NaN is not a data type. NaN does include a literal representation. To test for NaN, you must use the isNaN function. The following example illustrates this usage:

var Test = "Test String";
if (isNaN(parseInt(Test)))
TheApplication().RaiseErrorText("Test is Not a Number");

If the parseInt function attempts to parse Test String into an integer, then it returns NaN because Test String does not represent a number.

Numeric Constants

You can write code that references a numeric constant as a property of the Number object. A numeric constant does not include a literal representation.

Table 9 describes some numeric constants.

Table 9. Numeric Constants in Siebel eScript
Numeric Constant
Value
Description

Number.MAX_VALUE

1.7976931348623157e+308

Largest positive number.

Number.MIN_VALUE

2.2250738585072014e-308

Smallest positive nonzero value.

Number.NaN

NaN

Not a number.

Number.POSITIVE_INFINITY

Infinity

Number greater than MAX_VALUE.

Number.NEGATIVE_INFINITY

-Infinity

Number less than MIN_VALUE.

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.