# Any idea why 10^32 = -8814407033341083648

**URL:** <https://discourse.julialang.org/t/any-idea-why-10-32-8814407033341083648/16394>\
**Category:** General Usage\
**Created:** [October 16, 2018, 11:16am UTC](https://discourse.julialang.org/t/any-idea-why-10-32-8814407033341083648/16394 "2018-10-16T11:16:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucabrugnolini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucabrugnolini/32/2039_2.png) [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Post date:** [October 16, 2018, 11:16am UTC](https://discourse.julialang.org/t/any-idea-why-10-32-8814407033341083648/16394/1 "2018-10-16T11:16:19Z")

</div>

As in the topic title, I have found some strange behavior in Julia by exponentiating 10^large\_number. In particular, I get negative numbers for some exponents. Also, the log function is treating these numbers as complex.

Any idea why is this happening?

Here below I report some results:

```julia
julia> 10^15 == 1e15
true

julia> 10^20 == 1e20
false

julia> 10^20 ≈ 1e20
false

julia> 10^31
-4570789518076018688

julia> 10^32
-8814407033341083648

julia> 10^33
4089650035136921600

julia> 10^31 > 0
false

julia> 10^33 > 0
true

julia> log(10^31)
ERROR: DomainError:
log will only return a complex result if called with a complex argument. Try log(complex(x)).
Stacktrace:
 [1] nan_dom_err at ./math.jl:300 [inlined]
 [2] log at ./math.jl:419 [inlined]
 [3] log(::Int64) at ./math.jl:421

```

If I try the same on MATLAB I get

```nohighlight
>> 10^32 == 1e32

ans =

  logical

   1

>> 10^32

ans =

   1.0000e+32

```

I am on ubuntu 16.04 and Julia 0.6.3

---

<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:** [October 16, 2018, 11:18am UTC](https://discourse.julialang.org/t/any-idea-why-10-32-8814407033341083648/16394/2 "2018-10-16T11:18:14Z")

</div>

[https://docs.julialang.org/en/stable/manual/integers-and-floating-point-numbers/#Overflow-behavior-1](https://docs.julialang.org/en/stable/manual/integers-and-floating-point-numbers/#Overflow-behavior-1)

---

<div class="post-metadata">

**Author:** ![lucabrugnolini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lucabrugnolini/32/2039_2.png) [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Post date:** [October 16, 2018, 11:26am UTC](https://discourse.julialang.org/t/any-idea-why-10-32-8814407033341083648/16394/3 "2018-10-16T11:26:54Z")

</div>

Thanks a lot for the quick answer!
