File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
typed-racket-lib/typed-racket/base-env
typed-racket-test/succeed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 420420 (-> -NonPosInt -Int -NonPosFixnum)
421421 (binop -Int -Fixnum))))
422422
423+ (define fxpopcount-type
424+ (lambda ()
425+ (fx-from-cases
426+ (-Nat . -> . -NonNegFixnum)
427+ (-NonNegFixnum . -> . -NonNegFixnum)
428+ (-Int . -> . -Fixnum))))
429+
423430 ;; A bit of machinery to allow floating point operations to be abstracted over double/extended
424431 ;; floating point types without repetition.
425432 (define-syntax (define-fl-type-lambda stx)
19461953[fxlshift (fxlshift-type)]
19471954[fxrshift (fxrshift-type)]
19481955
1956+ [fxpopcount (fxpopcount-type)]
1957+ [fxpopcount16 (fxpopcount-type)]
1958+ [fxpopcount32 (fxpopcount-type)]
1959+
19491960[fx= (fx=-type)]
19501961[fx< (fx<-type)]
19511962[fx> (fx>-type)]
Original file line number Diff line number Diff line change 3838(check equal? (fxmin 3 2 ) 2 )
3939(check equal? (fxmax 3 4 ) 4 )
4040
41+ (check equal? (fxpopcount #x0fffffffffffffff ) 60 )
42+ (check equal? (fxpopcount32 #xffffffff ) 32 )
43+ (check equal? (fxpopcount16 #xffff ) 16 )
You can’t perform that action at this time.
0 commit comments