4 Arithmetic and Expressions

We will start with the simplest of all expressions:

4.1 Constants

BETA accepts constants in the usual formats:

4.1.1 Integer

1, 1666, 0, -12

There is also a format (<base>X<number>) for integers in other bases. All the following constants represents 11:

2x1011, 3x102, 16xB, 0xb, 11

Predefined constants exist for MaxInt and MinInt in betaenv.

4.1.2 Reals

3.14159, 3E9 , 3.14E-9

Predefined constants exist for MaxReal and MinReal in the math library.

4.1.3 Booleans

true, false

4.1.4 Textand Characters

'a', 'ABC'

a character is a text of length 1.

the text delimiter character can be represented by doubling: '''Hi''', is the text :'Hi'

following the C convention, many useful control characters can be introduced by using the backslash: '\t' for tabulator and '\n' for newline.


Libraries Tutorial
© 1994-2004 Mjølner Informatics
[Modified: Friday April 6th 2001 at 12:43]