Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Stata 12 MP rounds off large double value on read


From   "Golyaev, Konstantin" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Stata 12 MP rounds off large double value on read
Date   Tue, 9 Jul 2013 02:26:20 +0000

Dear Stata gurus,

I am trying to read a plain-text tab-delimited file from disk into Stata with the *insheet* command. There are three lines in the file that cause me trouble, and their values are:

9223372034619058931
9223372034619059031
9223372034619058731

The *insheet* command converts these to *double* storage type, and rounds each of these values to the same number: 9223372034619059200. I am puzzled as to what may be the underlying issue. Moreover, when I try to issue the following command:

generate double x = 9223372034619058931

I get the variable *x* with all values being equal to 9223372034619059200, again.

I have found a workaround by forcing Stata to read these numbers in as strings. But I would like to try to avoid this because of storage inefficiencies. 

Does anyone have any ideas what may be causing this behavior?

Thank you,

Konstantin Golyaev
Economist, Amazon.com
[email protected]


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index