开发者

POWER(@variable,2) SQL Server

I have a number like 8.32596e+010 when I try to do POWER(@variable,2) it says there is a f开发者_开发问答loating point error, How do you fix this??


The following T-SQL works for me, in SQL Server 2008:

declare @x float
declare @y float
set @x = 8.32596e+010
set @y = POWER(@x,2)
print @y

6.93216e+021

Check that you're declaring all variables as floats (or floating-point types).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜