Numerical Data


| HOME | BACK |

Overview

There are 6 types of standard numerical data, namely double, float, int, short, uchar and bool, as shown in the table below.

Name

Type

byte

Range

double

double precision floating point data

8

about +2.0e+308 (16 significant digits)

float

single precision floating point data

4

about +2.0e+38 (7 significant digits)

int

signed integer number

4

-2147483648 to 2147483649

short

signed short integer

2

-32767 to 32768

uchar

unsigned char

1

0 - 255

bool

boolean

1

0 -1

 

Function

Numerical data type has no class function.  Each data type name itself is in fact a global function,  for example:

->a = int()

->b = short(19.2)

a is an integer variable, having a value of "0"

b is a short integer variable, having a value of "19"

 

Casting

Casting between each type of numerical data is fully provided in Noobeed.  In an operator expression, casting is done in such away that the original data type gets a higher level of precision as much as the highest precision data type in the expression being evaluated.  In a function expression, casting is done on arguments of a function to make the data type of the arguments the same data type as what are declared in the function protocol.  

Example:

->a = int(8.1)

->a

  8

->b = sin(a)

the number 8.1 is converted to 8

 

 

variable a is converted to double precision, because the argument of function "sin" requires a double precision number.

 


| HOME | BACK |