in reply to Re^3: Which "use" statements in a module do "bubble up" to the callers?
in thread Which "use" statements in a module do "bubble up" to the callers? [SOLVED]

True. Also, the value of a constant is copied into the lexical pad of any code that uses it, just like a literal. And 22/7 is a slightly better approximation of π than 3.14, but 4*atan2(1,1) is much better.
  • Comment on Re^4: Which "use" statements in a module do "bubble up" to the callers?

Replies are listed 'Best First'.
Re^5: Which "use" statements in a module do "bubble up" to the callers?
by AnomalousMonk (Archbishop) on Aug 31, 2017 at 16:48 UTC
    ... 22/7 is ... slightly better ... but 4*atan2(1,1) is much better.

    And my favorite, 355/113, "slide-rule pi", is right in between the two!


    Give a man a fish:  <%-{-{-{-<

      Even better: Use M_PI from POSIX instead of PI. Oops, that does not illustrate the scope problem.
      Bill

        I had a vague recollection of a 4-digit/4-digit pi rational approximation that was better than 355/113, but a quick search of the Interwebs shows the next (slightly) better approximations come with 5-digit/5-digit ratios. I must have been thinking of some other rat-app.


        Give a man a fish:  <%-{-{-{-<

        Remember kids, always get the value of π from the same source. That way, if it changes, you won't have to hunt for it all over the place!