13.4.1.6 Numerical constants
13.4.1.6.1 Numerical integer constants
Binary
0b followed by a series of 0 and 1
Decimal
A series of numbers between 0 and 9
Hexadecimal
0x followed by a series of numbers between 0 and 9 and the letters a to f
13.4.1.6.2 Numerical floating-point constants
A floating-point number is a number with numbers after the decimal point. A floating-point number starts with
one or several numbers, includes a decimal point and has at least one number after the decimal point, e.g.
"12.0" and "0.75" are valid floating-point numbers. An exponent can optionally be added. The notation is the
letter "e" (lower case) followed by an integer numerical constant. For example, "3.12e4" or "12.3e-3" are valid
floating-point numbers with an exponent.
13.4.2 Variables
13.4.2.1 Declaration
The keyword "new" declares a new variable. For special declarations, the keyword "new" is replaced with
"static" (see "Static local declaration" on page 215). The value of the new variable is zero, provided that is not
initialised explicitly.
A variable declaration can appear
l
At every position at which an expression is valid - local variable
l
At every position at which a function declaration or the implementation of the function is valid - global
variables
l
In the first expression of a "for" loop (see "For (expression 1; expression 2; expression 3) statement" on
page 225) - local variable
Example:
new a;
// without initialisation (value is 0)
new b = 3; // with initialisation (value is 3)
13.4.2.2 Local declaration
A local declaration appears within a statement block. A variable can only be accessed within this block and
the blocks that it comprises. A declaration within the first expression of a loop instruction is also a local
declaration.
13.4.2.3 Global declaration
A global declaration appears outside of a function and a global variable can be used in any function. Global
variables can only be initialised with constant expressions.
214
Rev. 05
Summary of Contents for myDatalogEASY V3
Page 2: ......
Page 13: ...Chapter 2 Declaration of conformity Chapter 2 Declaration of conformity Rev 05 13 ...
Page 14: ......
Page 42: ......
Page 76: ......
Page 88: ......
Page 102: ......
Page 110: ......
Page 116: ......
Page 234: ......
Page 244: ......
Page 252: ......
Page 254: ......
Page 266: ......
Page 276: ......