Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: padding zeroes, writing functions


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: padding zeroes, writing functions
Date   Sat, 27 Jan 2007 20:12:43 -0800

Joe said:

5. Anything else that you need returned in double-precision. Now, if a user
takes the time to assure precision by bounding the error in a numerical
integration, for example, the integral still gets returned from Mata to
Stata in a single-precision return scalar.


This is patently untrue. There is no such thing in Stata as a single- precision scalar.

. mata
------------------------------------------------- mata (type end to exit) ---------
: pie=pi()

: printf("Pi is %20.14f \n",pie)
Pi is 3.14159265358979

: st_numscalar("r(joe)",pie)

: end
------------------------------------------------------------------------ -----------

. di %20.14f r(joe)
3.14159265358979


If you do not alter the display format, it does not display all those significant digits, but they are there.

Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
* 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/




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