[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Precision
By the way, when I did the -browse-, I noticed that even if the data
is correctly displayed in the "spreadsheet", it isn't so in the box
located in the upper side of the screen (under the HIDE button). In
the second case, I only see 348080.2688552. Kinda funny as the box
usually shows full precision even if the numbers are formatted as
%2.0f in the spreadsheet.
On 11/11/05, Michael Blasnik <email@example.com> wrote:
> You have forgotten to format the values properly, so you think you lost
> precision when you didn't. All of the digits in your example are maintained
> when you use doubles or destring. Try your code, but then :
> di %20.10f c
> Michael Blasnik
> ----- Original Message -----
> From: "Sergio Correia" <firstname.lastname@example.org>
> > However, as the following example can show, this is not enough to
> > maintain ALL the precision.
> > 1) make the data
> > input str20 x
> > 348080.2688552010
> > end
> > 2)
> > gen a=real(x)
> > gen double b=real(x)
> > destring x, gen(c)
> > browse
> > 3) Alternative (a) is pretty bad.
> > (b) and (c) give 3.4808026885520e+05, which is pretty close.
> > If that is not enough, I can't help.
> * 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/
* For searches and help try: