0

If i try using Math.Pow in a decimal variable i wont be allowed to do so because it needs to be a double. Is there any way i can print extremely precise powers? Extremely as in at least 50 or a hundred digits

President James K. Polk
  • 40,516
  • 21
  • 95
  • 125
  • Those dup targets have nothing at all to say about the crux of the question, namely arithmetic of higher precision than is available using standard C# arithmetic types. – President James K. Polk Jul 02 '20 at 16:55
  • 2
    Octavylon, it might help if you explained what you need this extreme precision for. Are you working with integers only, or with floating point numbers of arbitrary precision? – r3mainer Jul 02 '20 at 18:44
  • 64 bit `double` can store `~17` digits so if you want `50` digits you need higher precision arithmetics (at least `ceil(50/log10(2)) =167` bits of mantisa however depending on the algorithm you might need a multiple of it). google `BigDecimal,BigInteger` ... If you want to encode this your self see [Power by squaring for negative exponents](https://stackoverflow.com/a/30962495/2521214) – Spektre Jul 04 '20 at 09:24

0 Answers0