# The speed of light is an integer. Why should we care?

**URL:** <https://discourse.julialang.org/t/the-speed-of-light-is-an-integer-why-should-we-care/40108>\
**Category:** Internals & Design\
**Tags:** integer-overflow\
**Created:** [May 25, 2020, 5:16am UTC](https://discourse.julialang.org/t/the-speed-of-light-is-an-integer-why-should-we-care/40108 "2020-05-25T05:16:30Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [May 25, 2020, 10:08am UTC](https://discourse.julialang.org/t/the-speed-of-light-is-an-integer-why-should-we-care/40108/9 "2020-05-25T10:08:15Z")

</div>

In theory, it might be possible to detect integer overflow involving _constants_ without any runtime cost. (See my proposal [here](https://discourse.julialang.org/t/branch-on-whether-a-value-is-known-to-the-compiler/34850).), So code like

```julia
const c = 299_792_458; # the speed of light
...
planks_length = sqrt(G*h_bar/c^3)

```

_could_ give a warning.

However, this might actually make things _more_ confusing, because users who see this warning might assume that integer overflow always results in a warning, and then write code that gives overflow at runtime.

---

_[View the full topic](https://discourse.julialang.org/t/the-speed-of-light-is-an-integer-why-should-we-care/40108)._
