Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Some integers were too large for truncate-int to truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBurge committed May 3, 2018
1 parent 4948d51 commit 89f49c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/0044-negative-7.pmd
@@ -0,0 +1,7 @@
#lang pyramid

(require psl "primitives.pmd")

(set-test-result! 0)

(%#-box (%#-bitshiftl (%#-bitshiftl (unbox 1) (unbox 255)) (unbox 2)))
1 change: 1 addition & 0 deletions utils.rkt
Expand Up @@ -152,6 +152,7 @@

(: truncate-int (-> Integer Nonnegative-Integer))
(define (truncate-int x)
(set! x (modulo x WORDLIMIT))
(assert-natural
(if (>= x WORDLIMIT)
(- x WORDLIMIT)
Expand Down

0 comments on commit 89f49c9

Please sign in to comment.