The MSDN documentation at POWER, indicates that the first parameter past to it, is, or should be, convertible to a float
POWER ( float_expression , y )
but when you Run
`Select power(19.8, 2) withoutCast,
power(Cast(19.8 as float), 2) withCast`
you get:
withoutCast withCast
------------ ----------------------
392.0 392.04
The correct value of course, should be 392.04.
The function returns the wrong answer when the input parameter is not pre-cast to a float.
This apparently is documented by the statement in the MSDN docs that:
"Returns the same type as submitted in float_expression. For example, if a decimal(2,0) is submitted as float_expression, the result returned is decimal(2,0)."
However, if I submit 19.8 as the first expression, why is the function assuming it is a decimal(19,0) and truncating the fractional portion of the answer????