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

Re: st: Precision

From   "Michael Blasnik" <>
To   <>
Subject   Re: st: Precision
Date   Fri, 11 Nov 2005 09:54:37 -0500

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" <>

However, as the following example can show, this is not enough to
maintain ALL the precision.

1) make the data
input str20 x

gen a=real(x)
gen double b=real(x)
destring x, gen(c)

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:

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