diff options
author | Andre Polykanine <ap@oire.me> | 2019-02-20 01:27:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 01:27:51 +0200 |
commit | 67ffd4172c22901289761e4e885197ef3633b44d (patch) | |
tree | a2a8dc24b538bf3ce433439ac219e588687f293c /julia.html.markdown | |
parent | 1980272c4f37eae54f3b704e3fce2ba8fab00ecf (diff) | |
parent | 18c010ecd9b654be5bf6d4dfcd68aeb41edfc3a1 (diff) |
Merge pull request #3478 from tlienart/patch-1
[julia/en] Add note about integer overflow
Diffstat (limited to 'julia.html.markdown')
-rw-r--r-- | julia.html.markdown | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/julia.html.markdown b/julia.html.markdown index eabb988e..5e9ef1b8 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -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 |