# What's going on with exp() and --math-mode=fast?

**URL:** https://discourse.julialang.org/t/whats-going-on-with-exp-and-math-mode-fast/64619
**Category:** General Usage
**Tags:** fast-math
**Created:** [July 14, 2021, 8:34am UTC](https://discourse.julialang.org/t/whats-going-on-with-exp-and-math-mode-fast/64619 "2021-07-14T08:34:03Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)
#### Post date: [July 14, 2021, 9:23am UTC](https://discourse.julialang.org/t/whats-going-on-with-exp-and-math-mode-fast/64619/3 "2021-07-14T09:23:49Z")

</div>

This is old (before Julia 1.0), but I don’t know if the situation has changed. If not, that would explain the difference you observed:

> [@How to tell VS Code to use the fast math option?](https://discourse.julialang.org/t/how-to-tell-vs-code-to-use-the-fast-math-option/18257/2):
>
> You really don’t want to use --math-mode=fast. You’re telling the compiler to do something that’s fundamentally broken, e.g. [sinpi and cospi return incorrect results when using `--math-mode=fast` · Issue #30073 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/30073). The global flag is much worse than the occasional use of the @fastmath macro, which is far less broken, but still may cause incorrect results. You shouldn’t use --math-mode=fast unless you’re willing to take the risk that all of your results might be wrong.

---

_[View the full topic](https://discourse.julialang.org/t/whats-going-on-with-exp-and-math-mode-fast/64619)._
