Difference between revisions of "CINT"

From QB64 Wiki
Jump to navigation Jump to search
Line 2: Line 2:
''Useage:'' a% = CINT(DecimalNumber!)  
''Useage:'' a% = CINT(DecimalPointNumber!)  

Revision as of 06:09, 28 August 2009

CINT function rounds decimal point numbers up or down to the nearest integer value. Values greater than .5 are rounded up; .5 or lower are rounded down just like "bankers rounding".

Useage: a% = CINT(DecimalPointNumber!)

Example: a% = CINT(1.51)

Results: a% = 2

Warning: Since CINT is used for integer values, the input values cannot exceed 32767!

See also: CLNG, INT