Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exponents to higher powers of 10 resulting in missing values

    Hi Statalisters,
    I've encountered problem in Stata 14.1 that I cannot explain, and I haven't been able to find any posts or Stata literature regarding this problem. I have a formula to generate a new variable that works perfectly until I get to higher powers of 10. At higher values, Stata gives me a missing value. The first time this happens is when I try to raise 10 to the power of 320 within the formula. I can demonstrate this with the display function:

    display 10^(320)

    No answer appears.
    Please, can anyone explain this and/or recommend a work-around?

    Best wishes,
    Jan

  • #2
    Documented limits.


    Code:
    creturn list
    
    di c(maxdouble)
    https://www.stata.com/manuals/pcreturn.pdf

    The only work-around I know is to convert to a problem in logarithms.

    Comment


    • #3
      10^307 is about the upper limit for a double-type value.

      See help datatypes

      Also, when you wrote "No answer appears", I believe that you actually did get a response; it is a missing value -- a period.

      HTH
      --David

      Comment

      Working...
      X