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

st: decimals stored in Float

Subject   st: decimals stored in Float
Date   Fri, 18 Oct 2002 12:11:27 -0400

Decimals in float are stored differently than displayed.  Now, assume that
variable x=0.2 and it is stored in float and displays as a %9.2g.  If I execute
the command replace x=0.3 if x==0.2 no change is made.  This is because the
number 0.2 is stored as a number between 0.2 and 0.3 (?).  The manual suggest to
either write the command as replace x=0.3 if x==float(0.2), or to recast the
Float into a Double.  While the first option seem to work fine, the second
doesn't.  My question is: how can I get rid of the Float stored format and
actually have a 0.2 recognized as a 0.2?

Gero Carletto
Development Research Group
Room # MC3-554
The World Bank - 1818 H Street NW, Washington, DC 20433
tel: (202) 473-1377   Fax: (202) 522-1153
LSMS Web page:

*   For searches and help try:

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