Quantcast
Channel: The Stata Blog - Latest Comments
Viewing all articles
Browse latest Browse all 1126

Re: The Penultimate Guide to Precision

$
0
0

When Stata accesses the data, it copies values as needed, and convert them to double. Stata then performs all subsequent calculations using the double-precision value. Thus, comparing 10 (int type) with (10 float type) results in comparing 10 (double type) with 10 (double type). The result of calculation is also double. The result of comparing 10 (int type) with 10 (float type) is 1 (double type). 1 means true. If Stata is required to store the result into a variable in the data, Stata converts the result to the variable's storage type and copies the converted value. If the result cannot be converted because of limitations of the variable's storage type, Stata changes the the storage type of the variable to whatever is required.


Viewing all articles
Browse latest Browse all 1126

Trending Articles