Add note about integer overflow

Something that may trip users coming from a Python background as per https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773
This commit is contained in:
Thibaut Lienart 2019-02-18 12:25:23 +11:00 committed by GitHub
parent 1980272c4f
commit 18c010ecd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,13 @@ div(5, 2) # => 2 # for a truncated result, use div
# Enforce precedence with parentheses
(1 + 3) * 2 # => 8
# Julia (unlike Python for instance) has integer under/overflow
10^19 # => -8446744073709551616
# use bigint or floating point to avoid this
big(10)^19 # => 10000000000000000000
1e19 # => 1.0e19
10.0^19 # => 1.0e19
# Bitwise Operators
~2 # => -3 # bitwise not
3 & 5 # => 1 # bitwise and