Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Officially goin out of my mind. Trivial INT problem
#3
I don't know if IEEE was ever involved with 8-bit computers. But migrating from Color Computer to any IBM PC-Compatible object almost destroyed my faith in "INT()".

@bert22306 I might have been just like you thinking "INT()" should always just shave off the decimal part of a floating-point number, even a negative number. Like "-54.54" should just give "-54", right? But sadly QuickBASIC didn't work that way, "INT()" was made to work a lot like "floor()" in C. When I saw this in the "QuickBASIC Bible" book that I used to own, I weeped. It suggested using "FIX()" for what I wanted. What is even more sad is that more applications created with QuickBASIC and its descendants now rely on how "INT()" works influenced by IEEE, instead of how it worked on a given 8-bit computer.

This behavior has come down to what you have just discovered which is just sad. It could bring someone else (me on some days) to process a floating-point number as a string, search for the darned decimal point and just return whatever is "west" of that decimal point starting with the sign if it exists.

BTW I just don't know why "_ROUND()" was invented LOL, totally worthless to me.
Reply


Messages In This Thread
RE: Officially goin out of my mind. Trivial INT problem - by mnrvovrfc - 10-31-2022, 03:58 AM



Users browsing this thread: 5 Guest(s)