Statalist


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

st: Re: Precision for locals?


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: Re: Precision for locals?
Date   Wed, 12 Aug 2009 07:04:44 -0400

<>

. local s = c(pi)

. di "`s'"
3.141592653589793

. scalar twopi = 2.0*c(pi)

. local ss = twopi

. di "`ss'"
6.283185307179586


It appears that in this case the local (which is, after all, a string) has included all the significant digits of a double-precision constant.

Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html



On Aug 12, 2009, at 02:33 , Sergiy wrote:

what is the precision with which the locals are stored in Stata?
Help page for datatypes lists precision for doubles. Does it apply to locals?
Help page for limits does not answer this either.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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