Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Display of data in the Data Editor


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: Display of data in the Data Editor
Date   Tue, 8 Aug 2006 13:28:15 +0200

>From   Ngoc Anh Vo Thi <[email protected]>
To   [email protected]
Subject   st: Display of data in the Data Editor
Date   Tue, 8 Aug 2006 02:00:33 -0700 (PDT)

------------------------------------------------------------------------
--------

Ngoc Anh wrote:

I'm a new user of Stata. When I enter data into the
Data Editor, why is it displayed not exactly as what
I've entered?

Ex.: when I typed 6945.3 and then pressed Enter, it is
displayed like that in the cell reserved for it in the
spreadsheet. But when I reclick in that cell, on the
line at the very beginning of the Editor above the
spreadsheet, it is displayed like 6945.299999.

  Var2 [2] = 6945.299999

 	Var1	Var2
1
2		6945.3
--------------------------------------------------------

This is a general phenomenon, not specific to Stata.

Computers work with binary numbers, and the number 6945.3 has no exact
binary representation. So what is stored in the computer is probably
closer to 6945.299999 than to 6945.300000.

You can see more about this by:
   . help datatypes

Svend
__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796
Email: [email protected]
__________________________________________

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index