I am trying to calculate 2 ** 1000 and sum the values of digits. In all senses and purposes, it seems that I have the right methodology, but the wrong answer, and I'm not sure if there is a special way to make amounts, or maybe my options are spoiled.
In any case, 2 ** 1000 in R gives: 1.072e + 301. I used
options("scipen"=400, "digits"=4)
to get rid of scientific notation (because we want numbers), which gives me:
10715086071862673211222842640062602864002646240220400600628246062604626466468802860684246408802204448642628020644428680866666080884644840024840004280840848880462604626804200880464480884860464420284266864402822668802420668620402620400466086288824662642224206428624064400880244462828666486484022626226666
So, I am doing a naive thing and doing the sum () of these numbers:
sum(1,0,7,1,5,0...)
But the answer that I am leaving is 1200, which is incorrect. I can't figure out how the sum function will return something funky, so I assume that the parameters grafted the result of the exponent?
source
share