Math.Pow is not calculating correctly

后端 未结 6 1278
萌比男神i
萌比男神i 2020-12-01 18:52

I\'m having a problem with C#. To be precise with the Math.pow(). If I try to calculate 15^14 then I get \"29192926025390624\". But if I calculate it with Wolfram Alpha I ge

6条回答
  •  再見小時候
    2020-12-01 19:39

    C#'s Math.pow returns a Double, an IEEE 754 standard floating point number. It only has 15 significant digits:

    http://msdn.microsoft.com/en-us/library/system.math.pow.aspx http://math.byu.edu/~schow/work/IEEEFloatingPoint.htm

提交回复
热议问题