开发者

POWER(@variable,2) SQL Server

开发者 https://www.devze.com 2023-02-14 13:21 出处:网络
I have a number like 8.32596e+010 when I try to doPOWER(@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:

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

精彩评论

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

关注公众号