Changeset 15560


Ignore:
Timestamp:
Jan 4, 2013, 2:51:07 PM (6 years ago)
Author:
gb
Message:

In *-2: careful if multiplying MOST-NEGATIVE-FIXNUM by a BIGNUM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-numbers.lisp

    r14681 r15560  
    679679    (truncate x y)))
    680680
     681
    681682(defun *-2 (x y)
    682683  ;(declare (optimize (speed 3)(safety 0)))
     
    709710                      (complex (complex*real y x))))
    710711      (bignum (number-case y
    711                 (fixnum (multiply-bignum-and-fixnum x y))
     712                (fixnum
     713                 (if (eql y target::target-most-negative-fixnum)
     714                   (with-small-bignum-buffers ((by y))
     715                     (multiply-bignums x by))
     716                   (multiply-bignum-and-fixnum x y)))
    712717                (bignum (multiply-bignums x y))
    713718                (double-float (dfloat-rat * y x))
     
    716721                (complex (complex*real y x))))
    717722      (fixnum (number-case y
    718                 (bignum (multiply-bignum-and-fixnum y x))
     723                (bignum (if (eql x target::target-most-negative-fixnum)
     724                          (with-small-bignum-buffers ((bx x))
     725                            (multiply-bignums y bx))
     726                          (multiply-bignum-and-fixnum y x)))
    719727                (fixnum (multiply-fixnums (the fixnum x) (the fixnum y)))
    720728                (short-float (sfloat-rat * y x))
Note: See TracChangeset for help on using the changeset viewer.