# How to calculate a constant the first time a function is called?

**URL:** <https://discourse.julialang.org/t/how-to-calculate-a-constant-the-first-time-a-function-is-called/77506>\
**Category:** General Usage\
**Created:** [March 7, 2022, 1:41pm UTC](https://discourse.julialang.org/t/how-to-calculate-a-constant-the-first-time-a-function-is-called/77506 "2022-03-07T13:41:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 7, 2022, 1:55pm UTC](https://discourse.julialang.org/t/how-to-calculate-a-constant-the-first-time-a-function-is-called/77506/3 "2022-03-07T13:55:19Z")

</div>

see this thread: [In Julia, how to create a function that saves its own internal state?](https://discourse.julialang.org/t/in-julia-how-to-create-a-function-that-saves-its-own-internal-state/58457)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-calculate-a-constant-the-first-time-a-function-is-called/77506)._
