Project Euler #80: Square root digital expansion

  • + 1 comment

    "The square root of two is 1.41421356237309504880..., and the digital sum of the first one hundred decimal digits is 475."

    The explanation can be clearer, its not first one hundred decimal digits but first one hundred digits. Decimal digits starts after the decimal point. But the answer counts all digits including the one before decimal point.

    Also, set precision to higher than P, then truncate, e.g. P = 100, set precision to 110, then truncate the last 10 digits.