Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

RE: RE: st: A bug in egen and gen?

From   Maarten buis <>
Subject   RE: RE: st: A bug in egen and gen?
Date   Fri, 18 Feb 2011 16:59:22 +0000 (GMT)

--- On Fri, 18/2/11, Liao, Junlin wrote:
> Out of curiosity, do you know the maximum difference that
> the -recast- procedure allows to recast a variable from
> double to float?

The answer would have to be in terms of relative differences
not absolute differnces. I am still not as good at thinking 
in binary as Bill, so I use the rule of thumb that in float 
the first seven (decimal) digits are accurate, while for 
double it will be the first 16 digits. If you have very large
numbers to begin with, the absolute difference could be in the
10s, 100s, 1000s or even 10000s (compare Bill's example of
storing the US deficit as either a float or a double or:

-- Maarten

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index