typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

`abs` should add a case for `(-> Fixnum Nonnegative-Fixnum)`

Open LiberalArtist opened this issue 2 years ago • 2 comments

See https://github.com/racket/typed-racket/issues/1309 for a motivating example.

LiberalArtist avatar Feb 15 '23 12:02 LiberalArtist

One thing that should be looked out for is that (most-positive-fixnum) is less than (abs (most-negative-fixnum)) by one.

sorawee avatar Feb 15 '23 14:02 sorawee

Yes, as @sorawee points out this is unfortunately not true:

> (fixnum? (abs (most-negative-fixnum)))
#f

samth avatar Feb 15 '23 17:02 samth