mark-793554
SSC Journeyman
Points: 85
More actions
June 24, 2008 at 1:02 pm
#381357
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?
Michael Earl-395764
SSC Guru
Points: 53873
June 24, 2008 at 1:21 pm
#833564
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
#833590
Yeah, brilliant.
Thanks very much.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply