Double precision in C++ (or pow(2, 1000))

前端 未结 7 612
情书的邮戳
情书的邮戳 2021-01-14 19:38

I\'m working on Project Euler to brush up on my C++ coding skills in preparation for the programming challenge(s) we\'ll be having this next semester (since they don\'t let

7条回答
  •  無奈伤痛
    2021-01-14 20:12

    Isn't pow(2, 1000) just 2 left-shifted 1000 times, essentially? It should have an exact binary representation in a double float. It shouldn't require a bignum library.

提交回复
热议问题