Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extended KotD #25, #26, and #27: INTEGER DIVISION, CINT, and CLNG
#6
@Jack

Code: (Select All)
For i = -10 To 10
    x = i + .5
    Print x, Int(x), CInt(x), _Ceil(x)
Next

INT always rounds down.
_CEIL always rounds up.
CINT and CLNG ... rounds down if < 0.5, up if > 0.5, and to the nearest even integer if *exactly* 0.5.
Reply


Messages In This Thread
RE: Extended KotD #25, #26, and #27: INTEGER DIVISION, CINT, and CLNG - by SMcNeill - 05-04-2025, 02:09 PM



Users browsing this thread: 15 Guest(s)