sygerb77
SSC-Addicted
Points: 414
More actions
August 24, 2009 at 10:48 pm
#72410
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!
Mike_D
Hall of Fame
Points: 3295
August 25, 2009 at 1:01 am
#1044007
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
August 25, 2009 at 9:44 am
#1044304
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