Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extended KotD #25, #26, and #27: INTEGER DIVISION, CINT, and CLNG
#19
@SMcNeill:
This stream has already achieved one major goal: to raise awareness of the unexpected results we may get when using Integers

Your final short snippet sums up everything (at least, for me)!

value < 0.5 rounds down.
value = 0.5 rounds to the nearest even integer.
value > 0.5 rounds up.

X.49999999999999 rounds down.
x.50000000000001 rounds up.

If that's what happens in every case - pos or neg - then the world is sweet!
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


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



Users browsing this thread: 1 Guest(s)