Math.Sqrt() and Decimal

  • Thread starter Thread starter David Dvali
  • Start date Start date
David,

You will probably have to cast the Decimal type to a double, and then
cast the return value back to a decimal. Of course, the problem with this
is that it is a lossful conversion, which I am sure you don't want.

The reason for this I think is that when I check out Sqrt in Reflector,
it is an internal call, which makes me think that it just calls the same
function from the C runtime most likely.

If you want to do it to the decimal type, you will have to write the
routine yourself.

Hope this helps.
 
Back
Top