# Numerical Problems

**URL:** https://discourse.julialang.org/t/numerical-problems/37364
**Category:** General Usage
**Tags:** question
**Created:** [April 10, 2020, 6:57pm UTC](https://discourse.julialang.org/t/numerical-problems/37364 "2020-04-10T18:57:00Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [April 11, 2020, 7:36am UTC](https://discourse.julialang.org/t/numerical-problems/37364/11 "2020-04-11T07:36:33Z")

</div>

@Andres_Gonzalez, please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530), this makes it much easier to read.

Note that all practical MCMC code works in _log_ densities, where numerical overflow/underflow is much less acute of an issue. I see that you are doing this to some extent, but you may want to use somethng like

```julia
using Random
if randexp() < -(logNew - logOld)
    ...

```

---

_[View the full topic](https://discourse.julialang.org/t/numerical-problems/37364)._
