Changeset 8915


Ignore:
Timestamp:
Mar 28, 2008, 2:05:58 AM (11 years ago)
Author:
gb
Message:

Check for / by 0. Didn't this get fixed already ?

File:
1 edited

Legend:

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

    r8818 r8915  
    708708            (build-ratio x y)
    709709            (build-ratio (%fixnum-truncate x gcd) (%fixnum-truncate y gcd))))))
    710     (let ((gcd (gcd x y)))
    711       (if (eql gcd 1)
    712         (build-ratio x y)
    713         (build-ratio (truncate x gcd) (truncate y gcd))))))
     710    (if (eql y 0)
     711      (error 'division-by-zero :operation '/ :operands (list x y))
     712      (let ((gcd (gcd x y)))
     713        (if (eql gcd 1)
     714          (build-ratio x y)
     715          (build-ratio (truncate x gcd) (truncate y gcd)))))))
    714716
    715717
Note: See TracChangeset for help on using the changeset viewer.