Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Stata cannot do math?

From   Yu Xue <>
Subject   st: Stata cannot do math?
Date   Wed, 18 May 2011 18:44:14 -0500

Hi All,

This may be a stupid question. Here are the command and Stata output:

.set obs 50
.gen a=100.1
.count if a==100.1
.tab a
.sum a
variable  obs  mean  s.d.  min    max
a            50    100.1  0    100.1  100.1
.gen b=a-100
.tab b

So, Stata shows that a is equal to 100.1, but actually, it is equal to

Can anyone explain to me what this is? Do I have to set precision when
I do math in Stata? How to set precision?

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index