June 24, 2008 at 1:02 pm
Hi,
Simple question (I hope)........... Why does FLOOR(-0.25) = -1 and FLOOR(-1/4) = 0
I've got a fairly large bit of Math which basically doesn't work because of this. Any ideas?
June 24, 2008 at 1:21 pm
Data type.
Try this:
SELECT FLOOR(-0.25), FLOOR(-1/4), FLOOR(-1/4.0)
-1/4 is integer/integer which gets rounded to an integer.
June 24, 2008 at 2:18 pm
Yeah, brilliant.
Thanks very much.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy