Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Precision of SQRT and POWER

$
0
0

Hello everybody,

following

DECLARE @arg AS DECIMAL(38, 19) = 25000000000000.000100

SELECT POWER(@arg, 0.5) AS power_result
,SQRT(@arg) AS sqrt_result

returns 5000000 though 5000000.00000000001 would be correct answer (and it is well inside the precision of the input parameter). The POWER-result would let one even assume that it is correct to the given precision, but it is not.

Are there any workarounds?



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>