beautypg.com

Remote Processing CAMBASIC User Manual

Page 99

background image

Comm ands - 66

INT

Numeric Fun ction

SYNTAX:

a = INT(b)

PURPOSE:

To re turn an inte ger that is eq ual to or less tha n the argu ment.

REMARK S:

The integer portion is stored in variable “a” as a floating point number.

RELATED:

MOD , " \" integer divide

EXAMPLE:

PRINT INT(45.67)
45

PRINT INT(–15.02)
–16

To produce true r ounding to the closest whole number, use the following syntax:

A=INT(B+0.5)

Adding 0. 5 provides the true r ounding and emulates the C INT func tion found in other BASIC s.

ERROR:

none