10-31-2022, 03:58 AM
(This post was last modified: 10-31-2022, 03:59 AM by mnrvovrfc.
Edit Reason: I've edited like 75% of my posts
)
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.
@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.