4 ms·
Floats have rather limited precision for this type of computation for large n (gp's post had n=1e9). If you were to go with big-floats instead, then the resulti
by conistonwater 11y ago
Floats have rather limited precision for this type of computation for large n (gp's post had n=1e9). If you were to go with big-floats instead, then the resulting arithmetic will be more expensive that the straightforward big-integer arithmetic.