Changeset 26632 in project


Ignore:
Timestamp:
05/05/12 15:34:11 (8 years ago)
Author:
sjamaan
Message:

numbers: Fix stupid arithmetic-shift edge case in schemification branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/numbers/branches/schemification/numbers.scm

    r26606 r26632  
    522522(define fxlength (##core#primitive "fix_length"))
    523523
    524 (define-inline (%int-shift-fix int amount)
     524(define (%int-shift-fix int amount)
    525525  (cond
    526526   ((eq? amount 0) int)
     
    530530    (let ((value (if (eq? (%check-number int) BIG) int (%fix->big int))))
    531531      (%big-shift-left value amount)))
     532   ((eq? amount most-negative-fixnum)   ; Annoying edge case: (fxneg m-n-f) = 0
     533    ;; XXX This could just return -1 unconditionally, I think
     534    (%int-shift-fix (%int-shift-fix int (fx+ amount 1)) -1))
    532535   (else
    533536    (if (eq? (%check-number int) BIG)
Note: See TracChangeset for help on using the changeset viewer.