Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extended KotD #25, #26, and #27: INTEGER DIVISION, CINT, and CLNG
#14
(05-04-2025, 04:44 PM)SMcNeill Wrote: From what I can tell we seem to mimic QB45 perfectly.  It's just we haven't really documented this behavior and explained it very well for people in the past.  The wiki is woefully lacking important details about exactly how people should expect CINT, CLNG, and _ROUND to work.
But you should also say that this is only the case with one decimal place.
from 0.55 the behavior is changed .

Code: (Select All)

For i = 1 To 10
    x = i + .55
    Print x, CInt(x)
Next

Code: (Select All)

1.55     2
2.55     3
3.55     4
4.55     5
5.55     6
6.55     7
7.55     8
8.55     9
9.55     10
10.55    11
Reply


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



Users browsing this thread: 16 Guest(s)