Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Possible error in the latest stata


From   "Michael Blasnik" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Possible error in the latest stata
Date   Mon, 16 Jan 2006 19:47:28 -0500

This is a faq, see

http://www.stata.com/support/faqs/data/float.html

Computers work in binary and Stata is very precise about equality comparisons.

Michael Blasnik
michael.blasnik@verizon.net

----- Original Message ----- From: <Mlokshin@worldbank.org>
To: <statalist@hsphsun2.harvard.edu>
Sent: Monday, January 16, 2006 4:32 PM
Subject: st: Possible error in the latest stata



Dear Statalist,

This is the problem I have with the latest update of Stata:

in any existing dataset or set obs 100

. gen k=0.4
. count if k==0.4
0

if you browse this new variables you would see that k is equal not to 0.4 but
0.4000001,

Interestingly, if you gen k=0.5, 0.41... everything is fine, but the problem
persists for 0.6, 0.7, 0.8.

Michael
*
*   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–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index