Problem using POWER function with a negative exponent

  • I'm trying to use the POWER function with a negative exponent and find that it returns 0 everytime. Anyone know how to get this to work properly?

    Ex. POWER(2, -3)

    Thanks!

  • I think you will find that the result is the same type as the numeric expression so 2 is type int therefore you get zero. Try something like:

    SELECT POWER(CONVERT(float,2),-3)

    Hope that helps,

    Mike

  • Awesome. Thanks so much Mike!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply