From 17672da9eac0d958c51070339270f900b9ffce5e Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Mon, 3 Feb 2014 09:19:53 -0800 Subject: [PATCH] Add tests for fixnum operations on the boundary conditions. Also change type of - on negative fixnums to be more precise. original commit: 7b8b2cf3244b812c318f2d332cbd50441b917845 --- .../base-env/base-env-numeric.rkt | 3 +- .../optimizer/missed-optimizations/fixnum.rkt | 87 ++++++++++++++++--- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt index c8c039b3..4483ade4 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt @@ -1197,6 +1197,7 @@ (-> -PosFixnum -One -NonNegFixnum) (-> -PosInt -One -Nat) (-> -NonNegFixnum -NonNegFixnum -Fixnum) + (-> -NegFixnum -NonPosFixnum -Fixnum) (->* (list -PosInt -NonPosInt) -NonPosInt -PosInt) (->* (list -Nat -NonPosInt) -NonPosInt -Nat) (->* (list -NegInt -Nat) -Nat -NegInt) @@ -2098,4 +2099,4 @@ [unsafe-make-flrectangular (make-flrectangular-type)] [unsafe-flreal-part (flreal-part-type)] [unsafe-flimag-part (flimag-part-type)] -[unsafe-flrandom (flrandom-type)] \ No newline at end of file +[unsafe-flrandom (flrandom-type)] diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/missed-optimizations/fixnum.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/missed-optimizations/fixnum.rkt index cab65619..3b0815c4 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/missed-optimizations/fixnum.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/missed-optimizations/fixnum.rkt @@ -1,16 +1,35 @@ #;#; #<