Skip to content

DataTypes

hyst329 edited this page Oct 31, 2014 · 1 revision

Data types in f4

Basic types

Currently, f4 supports 2 data types : int (integer) and real (real number). To declare a variable of a given type, simply write: int a, int b = 2 or real x = 9.75. If a variable isn't initialised, a default value (0 for int and 0.0 for real) will be assigned to it.

Arrays

To declare an array, write int.6 x, int.(a + b) y (of course, if a and b were previously declared)

Note. Array initialisation (on declaring) is not supported yet.

To assign a value to a variable or array element, write a = 42 or x.3 = 13.

Clone this wiki locally