Changeset 3584


Ignore:
Timestamp:
09/05/03 14:29:43 (20 years ago)
Author:
piso
Message:

number(BigInteger? numerator, BigInteger? denominator): handle division by zero
properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/Lisp.java

    r3565 r3584  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Lisp.java,v 1.124 2003-09-03 23:40:10 piso Exp $
     5 * $Id: Lisp.java,v 1.125 2003-09-05 14:29:43 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    585585
    586586    public static final LispObject number(BigInteger numerator,
    587         BigInteger denominator) throws LispError
    588     {
    589         if (denominator.equals(BigInteger.ZERO))
    590             throw new LispError("division by zero");
     587                                          BigInteger denominator)
     588        throws LispError
     589    {
     590        if (denominator.signum() == 0)
     591            throw new DivisionByZero();
    591592        if (denominator.signum() < 0) {
    592593            numerator = numerator.negate();
Note: See TracChangeset for help on using the changeset viewer.