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]

st: RE: Problem with "real" command

From   Nick Cox <>
To   "''" <>
Subject   st: RE: Problem with "real" command
Date   Wed, 29 Jun 2011 13:24:36 +0100

This is not a problem with the -real()- function at all. The problem lies in your use by default of a -float- variable type. 

You need to use a more appropriate storage type, e.g. -double-, to avoid precision problems. 

. gen double numven6=real("600010154088")

. format numven6 %18.0f

. l numven6 in 1

     |      numven6 |
  1. | 600010154088 |

-search precision- for many sources of further information. 


Jérôme Fauconnier

When I  use the "real" function with large numbers, I have random results as  :

command :
gen numven6=real("600010154088")

i get the following result :


Have anybody had the same problem?

*   For searches and help try:

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