Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Integer-overflow/Clojure/integer-overflow-1.clj
Normal file
4
Task/Integer-overflow/Clojure/integer-overflow-1.clj
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(* -1 (dec -9223372036854775807))
|
||||
(+ 5000000000000000000 5000000000000000000)
|
||||
(- -9223372036854775807 9223372036854775807)
|
||||
(* 3037000500 3037000500)
|
||||
8
Task/Integer-overflow/Clojure/integer-overflow-2.clj
Normal file
8
Task/Integer-overflow/Clojure/integer-overflow-2.clj
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(set! *unchecked-math* true)
|
||||
(* -1 (dec -9223372036854775807)) ;=> -9223372036854775808
|
||||
(+ 5000000000000000000 5000000000000000000) ;=> -8446744073709551616
|
||||
(- -9223372036854775807 9223372036854775807) ;=> 2
|
||||
(* 3037000500 3037000500) ;=> -9223372036709301616
|
||||
; Note: The following division will currently silently overflow regardless of *unchecked-math*
|
||||
; See: http://dev.clojure.org/jira/browse/CLJ-1253
|
||||
(/ (dec -9223372036854775807) -1) ;=> -9223372036854775808
|
||||
Loading…
Add table
Add a link
Reference in a new issue