Scientific notation vs 10^

The reason is because you are using an integer to compute the powers of 10 in the first example, and integers in Julia overflow. See for yourself:

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

9 Likes