Community QBasic

Rebooting the QBasic we all know and love!


Project maintained by Cory Smith

CINT

Rounds a numeric expression to an integer value.

Syntax

CINT(numeric_expression)

Comments

If numeric_expression is not within the range of -32768 to 32767, an Overflow error occurs.

CINT rounds; it does not truncate.

See the FIX and INT functions, both of which return integers.

Examples

PRINT CINT(45.67)
 46

45.67 is rounded up to 46.

Note

See the CDBL, CLNG and CSNG functions for converting numbers to the double-precision and single-precision data types, respectively.

See Also