3 ms·
In that case you should likely have used fixed point arithmetic to start with. Doubles larger than 2^52 are no different from smaller numbers in context of sci
by dagss 8y ago
In that case you should likely have used fixed point arithmetic to start with.
Doubles larger than 2^52 are no different from smaller numbers in context of scientific computing etc. which is what floating point is for.
E.g. in a particular numerical simulation you could bump above 2^52 by using units of nanometers or below by using units of kilometers... yet this is likely just a simple multiplicative factor and the result of the calculation does not change one bit because of what units of measurement you use.
Getting closer to 10^300 and it is another story.
- dasyatidprime 8y ago“I would have liked to be able to represent (1 << 53) + 1 exactly, but all I have is JavaScript and importing a bignum library is a lot harder than just restricting the range” seems like an unfortunately common problem.