# "sum(\[1.0, 1e100, 1.0, -1e100\])" fails

**URL:** <https://discourse.julialang.org/t/sum-1-0-1e100-1-0-1e100-fails/76502>\
**Category:** General Usage\
**Tags:** question, numbers\
**Created:** [February 15, 2022, 6:37pm UTC](https://discourse.julialang.org/t/sum-1-0-1e100-1-0-1e100-fails/76502 "2022-02-15T18:37:01Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [February 15, 2022, 7:16pm UTC](https://discourse.julialang.org/t/sum-1-0-1e100-1-0-1e100-fails/76502/6 "2022-02-15T19:16:33Z")

</div>

> [@rafael.guerra](#):
>
> `Rational`

that’s kind of cheating… might as well just use more precision?

```julia
julia> setprecision(800) do # you can do this globally
           sum(BigFloat[1.0, 1e100, 1.0, -1e100])
       end
2.0

```

---

_[View the full topic](https://discourse.julialang.org/t/sum-1-0-1e100-1-0-1e100-fails/76502)._
