FLOOR Function Problems

  • 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?

  • 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.

  • 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