INT() always rounds the number down.
If you want it to round as a normal human would round such as 4.5 to 5 instead of what Qbasic would do and round 4.5 to 4 then just add .5
a=4.5
If you wanted to round like a normal human then you would
a=a+.5
PRINT INT(a)
Answer is 5
Or just round like the computer would
PRINT INT(a)
Answer is 4
To round like a human, use the CINT() function. On extremely large numbers, using CINT() will give you an error. That is why most people use the INT() function whenever possible.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.