Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Integer-overflow/Racket/integer-overflow.rkt
Normal file
20
Task/Integer-overflow/Racket/integer-overflow.rkt
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#lang racket
|
||||
(require racket/unsafe/ops)
|
||||
|
||||
(fixnum? -1073741824) ;==> #t
|
||||
(fixnum? (- -1073741824)) ;==> #f
|
||||
|
||||
(- -1073741824) ;==> 1073741824
|
||||
(unsafe-fx- 0 -1073741824) ;==> -1073741824
|
||||
|
||||
(+ 1000000000 1000000000) ;==> 2000000000
|
||||
(unsafe-fx+ 1000000000 1000000000) ;==> -147483648
|
||||
|
||||
(- -1073741823 1073741823) ;==> -2147483646
|
||||
(unsafe-fx- -1073741823 1073741823) ;==> 2
|
||||
|
||||
(* 46341 46341) ;==> 2147488281
|
||||
(unsafe-fx* 46341 46341) ;==> 4633
|
||||
|
||||
(/ -1073741824 -1) ;==> 1073741824
|
||||
(unsafe-fxquotient -1073741824 -1) ;==> -1073741824
|
||||
Loading…
Add table
Add a link
Reference in a new issue