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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extended KotD #23 and #24: _MIN and _MAX SMcNeill 0 590 01-16-2025, 09:51 AM
Last Post: SMcNeill
  Extended KotD #22: _MOUSEHIDDEN SMcNeill 0 595 01-14-2025, 12:29 AM
Last Post: SMcNeill
  Extended KotD #20: _NOTIFYPOPUP SMcNeill 4 1,300 12-05-2024, 01:55 AM
Last Post: Pete
  Extended KotD #21: _MIDISOUNDBANK a740g 8 2,707 08-30-2024, 07:32 PM
Last Post: Steffan-68
  Extended KotD #19: _UCHARPOS SMcNeill 1 869 06-26-2024, 12:54 AM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: