Difference between revisions of "CINT"

From QB64 Wiki
Jump to navigation Jump to search
(Created page with ''''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. ''Useage:'' a% = …')
 
Line 1: Line 1:
 
'''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.
 
'''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.
  
''Useage:'' a% = CINT(decimal!)  
+
''Useage:'' a% = CINT(DecimalNumber!)  
  
Since CINT is used for integer values, the value cannot exceed 32767!
+
''Example:'' a% = CINT(1.51)
 +
 
 +
''Results:'' a% = 2
 +
 
 +
Since CINT is used for integer values, the input values cannot exceed 32767!
  
 
''See also:'' [[CLNG]]
 
''See also:'' [[CLNG]]

Revision as of 05:43, 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.

Useage: a% = CINT(DecimalNumber!)

Example: a% = CINT(1.51)

Results: a% = 2

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

See also: CLNG