Statalist


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

st: AW: RE: AW: forvalues i = 0(.05).15


From   David Airey <[email protected]>
To   Statalist <[email protected]>
Subject   st: AW: RE: AW: forvalues i = 0(.05).15
Date   Mon, 9 Nov 2009 15:13:04 -0600

Oh. Duh. You are right. I will follow Nick's advice and keep my forval loops integers whenever possible.

-Dave


This behavior is intentional, though: The step size for this particular syntax is the difference between the first and the second argument, i.e. 31.6-31.3=0.3, so it cannot hit the 38 exactly and stops short of it. To get
an exact hit, increase the upper bound to 38.2...


*************
forval x = 31.3 31.6 : 38.2 {
                di `x'
          }
*************


HTH
Martin


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index