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, statalist.org is already up and running.


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

Re: st: In search of the lost precision


From   Farshad Pourmalek <pourmalek_farshad@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: In search of the lost precision
Date   Thu, 30 Jun 2011 13:10:42 -0700 (PDT)

Sorry for the left-truncated message! Here it is: 

Thank you Austin. The resultant variable is string and destringing it results in a double equal to .1541439957645 that has lost the terminal .000000000000484, which is needed for precision of further calculations. 


--- On Thu, 6/30/11, Farshad Pourmalek <pourmalek_farshad@yahoo.com> wrote:

> From: Farshad Pourmalek <pourmalek_farshad@yahoo.com>
> Subject: Re: st: In search of the lost precision
> To: statalist@hsphsun2.harvard.edu
> Date: Thursday, June 30, 2011, 1:02 PM
> further calculations. 
> 
> --- On Thu, 6/30/11, Austin Nichols <austinnichols@gmail.com>
> wrote:
> 
> > From: Austin Nichols <austinnichols@gmail.com>
> > Subject: Re: st: In search of the lost precision
> > To: statalist@hsphsun2.harvard.edu
> > Date: Thursday, June 30, 2011, 12:21 PM
> > Farshad Pourmalek <pourmalek_farshad@yahoo.com>:
> > 
> > clear all
> > set obs 1
> > g v1=".154143995764484"
> > tempfile v
> > outsheet v1 using `v'
> > insheet using `v', clear double
> > list
> > infile str16 v1 using `v', clear
> > drop in 1
> > list
> > 
> > 
> > On Thu, Jun 30, 2011 at 3:04 PM, Farshad Pourmalek
> > <pourmalek_farshad@yahoo.com>
> > wrote:
> > > Hi!
> > >
> > > Is there a way to insheet 0.154143995764484
> without
> > losing precision?
> > >
> > > I used Stata IC 9.1 for Windows as below
> > >
> > > insheet using "C:\data\0.154143995764484.csv",
> clear
> > > codebook
> > > * It is float, %9.0g, .15414399, not
> .154143995764484
> > >
> > > insheet using
> "C:\data\0.154143995764484.csv",clear
> > double
> > > codebook
> > > * It is double, %10.0g, .1541439957645, not
> > .154143995764484
> > >
> > > Thank you,
> > > Farshad Pourmalek
> > *
> > *   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/
> > 
> 
> *
> *   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/
> 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index