# Julia messes up integer exponents?

**URL:** <https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773>\
**Category:** Performance\
**Tags:** integer-overflow\
**Created:** [February 14, 2019, 4:19am UTC](https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773 "2019-02-14T04:19:42Z")\
**Posts on this page:** 1\
**Showing post:** 107

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [February 18, 2019, 12:51am UTC](https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773/107 "2019-02-18T00:51:20Z")

</div>

> [@bennedich](#):
>
> what if you have a “checked arithmetic” flag that only affects code in the user’s package/module

If you mean to check arithmetic operations syntactically present in user’s code, I guess it can be done already with a module exporting checked version of these operations? You can put `using CheckedArithmetics` (say) in the beginning of the module (maybe with `if ENV["CHECK_ARITHMETICS"] == "true" ... end` so that it’s easier to turn on/off). I used the same trick to [change the associativity of `*`](https://discourse.julialang.org/t/why-is-multiplication-a-b-c-left-associative-foldl-not-right-associative-foldr/17552/27).

---

_[View the full topic](https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773)._
