Originally posted by Daniel Shin
View Post
My perspective on the original issue of precision is this. Every language is bound by the limitations of performing decimal arithmetic on a binary computer with finite precision. When numbers grow too big or too small for the available precision, then the program can do one of a few things: throw some kind of error or exception, ignore it and truncate as necessary, or impute a missing value. It's the onus of the programmer to understand these limitations and at some point, we come to learn it, even if it is because it causes some problem later. We've already discussed three mitigation strategies here (use a bigger storage type, use clonevar, or don't use that piece of code). Two of those don't even really require an understanding of the precision issue. At some point, the programmer must take responsibility for the actions of the code and understanding what it does.
On a related note, there are some on the forum, including me, who wish to see Stata support a new datatype similar to the Java BigInteger which could be useful for identification variables. There is also the idea that identification variables could better be stored as string variables when the numbers are too large, but that causes issues for some estimation routines which expect numerical data only.


Comment