[Contents] · [Home] · [Mail]

SALIERI Language - INT

Type:
INT: simple -> integer

Call syntax:
INT(anObject)

Description:
INT converts boolean, integer, real, and string objects into integer values. The boolean values FALSE and TRUE are converted into 0 and 1; real numbers are converted by truncating the non-integer part (as opposed to the conversion realized by ceil and floor).

string values are interpreted as integer values, non-integer parts are truncated if specified. If a string value does not correspond to a valid integer or real value, INT returns 0.

Example:
> INT(TRUE)
Result= 1
> INT(2.9)
Result= 2
> INT(-2.9)
Result= 2
> INT("hallo")
Result= 0
> INT("2.3a")
Result= 2
> INT(2.3a)
Error in command-line:
parse error

See also:


[Contents] · [Home] · [Mail]
© sic!systems, page frame designed by hh; this page has been automatically generated from the SALIERI Documentation Database.