Numbers

Silk Performer distinguishes between integers and floating-point numbers. The range of integer values is -231 to 231-1 (-2147483648 to 2147483647). The range of floating-point values is 1.7E +/- 308 (15 digits). Integer values can be represented in decimal or in hexadecimal format.

Syntax

number   = digit { digit } | "0x" hexdigit { hexdigit }.
signum   = [ "+" | "-" ] number.
float    = [ "+" | "-" ] digit { digit } "." digit { digit }.
digit    = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9".
hexdigit = digit | "A" | "B" | "C" | "D" | "E" | "F".

Example

dcltrans 
  transaction TMain 
  var 
    nValue1, nValue2, nValue3:  number; 
  begin 
    nValue1 := -99; 
    nValue3 := nValue2; 
  end TMain;

The following numbers are valid:

  • 1
  • 01
  • +1234
  • -2378999
  • 0x1F
  • 0xEFA0
  • 1.0
  • 1.999
  • 20000.00001
  • -1.1

The following are invalid numbers:

  • 1.
  • .01
  • 99999999999
  • 12a