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   Ngoc Anh Vo Thi <vtnanh@yahoo.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re:st: Display of data in the Data Editor
Date   Fri, 11 Aug 2006 09:14:08 -0700 (PDT)

Thanks Svend Juul and Allan Reese for your helpful
answers!

Ngoc Anh

Date: Wed, 9 Aug 2006 12:34:05 +0100
From: "Allan Reese \(Cefas\)"
<allan.reese@cefas.co.uk>
Subject: st: Display of data in the Data Editor

Ngoc Anh asked why 6945.3 is displayed like
6945.299999.

Svend Juul explains, correctly, that computers work
with binary 
numbers, 
and the number 6945.3 has no exact binary
representation. 
_________________________________________

The display in the data editor is controlled by the
format for the 
number, which Ngoc Anh can change.  However, I
recently fell foul of the 
finite precision problem by creating new cases by
copy'n'paste.  Although 
the new cases looked to have the same value, they
sorted separately 
from the old ones.

The command "replace x=x[_n-1] in 11/20" 
would have copied the value keeping the same random
bits at the end.  
Setting the format as %20.19 showed why the values as
pasted were 
different.

Allan Reese


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index