# Scientific notation vs 10^

**URL:** <https://discourse.julialang.org/t/scientific-notation-vs-10/98849>\
**Category:** General Usage\
**Created:** [May 14, 2023, 9:31pm UTC](https://discourse.julialang.org/t/scientific-notation-vs-10/98849 "2023-05-14T21:31:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ke\_Gao](https://avatars.discourse-cdn.com/v4/letter/k/71e660/32.png) [@Ke\_Gao](https://discourse.julialang.org/u/Ke_Gao)\
**Post date:** [May 14, 2023, 9:31pm UTC](https://discourse.julialang.org/t/scientific-notation-vs-10/98849/1 "2023-05-14T21:31:08Z")

</div>

```shell
julia> a = 6.02*10^23
1.2062660515345518e18

julia> b = 6.02e23
6.02e23

julia> a == b
false

```

Why is a not equals to b?  
Any help possible is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 14, 2023, 9:39pm UTC](https://discourse.julialang.org/t/scientific-notation-vs-10/98849/2 "2023-05-14T21:39:13Z")

</div>

The reason is because you are using an integer to compute the powers of 10 in the first example, and [integers in Julia overflow](https://discourse.julialang.org/t/discussion-about-integer-overflow/69627). See for yourself:

```julia
julia> 10^23
200376420520689664

julia> 10.0^23
1.0e23

```

The first computation yields a number that is larger than the largest 64-bit integer, so it is very wrong.  
The second computation uses a floating point number, so it is approximate but it can cover a wider range of values

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [May 14, 2023, 10:23pm UTC](https://discourse.julialang.org/t/scientific-notation-vs-10/98849/3 "2023-05-14T22:23:46Z")

</div>

The Int64(10)^23 has overflowed

```julia
julia> 10^23
200376420520689664

julia> big(10)^23
100000000000000000000000

julia> a=6.02*big(10)^23
6.019999999999999573674358543939888477325439453125e+23

julia> b=6.02e23
6.02e23

julia> a == b
false

julia> a - b
-3.84382601456060111522674560546875e+07

```
