Changeset 3341


Ignore:
Timestamp:
08/12/03 02:06:53 (18 years ago)
Author:
piso
Message:

ZEROP()

Location:
trunk/j/src/org/armedbear/lisp
Files:
6 edited

Legend:

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

    r3334 r3341  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Bignum.java,v 1.17 2003-08-11 18:03:15 piso Exp $
     5 * $Id: Bignum.java,v 1.18 2003-08-12 02:06:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    101101    }
    102102
     103    public LispObject ZEROP()
     104    {
     105        return NIL;
     106    }
     107
    103108    public static BigInteger getValue(LispObject obj) throws LispError
    104109    {
  • trunk/j/src/org/armedbear/lisp/Complex.java

    r3338 r3341  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Complex.java,v 1.1 2003-08-12 01:33:31 piso Exp $
     5 * $Id: Complex.java,v 1.2 2003-08-12 02:06:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5757    }
    5858
     59    public LispObject ZEROP() throws TypeError
     60    {
     61        if (realpart.ZEROP() != NIL && imagpart.ZEROP() != NIL)
     62            return T;
     63        return NIL;
     64    }
     65
    5966    public String toString()
    6067    {
  • trunk/j/src/org/armedbear/lisp/Fixnum.java

    r3334 r3341  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Fixnum.java,v 1.42 2003-08-11 18:03:15 piso Exp $
     5 * $Id: Fixnum.java,v 1.43 2003-08-12 02:06:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    112112            return false;
    113113        }
     114    }
     115
     116    public LispObject ZEROP()
     117    {
     118        return value == 0 ? T : NIL;
    114119    }
    115120
  • trunk/j/src/org/armedbear/lisp/LispFloat.java

    r3334 r3341  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: LispFloat.java,v 1.14 2003-08-11 18:03:15 piso Exp $
     5 * $Id: LispFloat.java,v 1.15 2003-08-12 02:06:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    9898            return value == ((Ratio)obj).floatValue();
    9999        return false;
     100    }
     101
     102    public LispObject ZEROP()
     103    {
     104        return value == 0 ? T : NIL;
    100105    }
    101106
  • trunk/j/src/org/armedbear/lisp/LispObject.java

    r3237 r3341  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: LispObject.java,v 1.26 2003-08-06 17:45:01 piso Exp $
     5 * $Id: LispObject.java,v 1.27 2003-08-12 02:06:53 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    109109    }
    110110
     111    public LispObject ZEROP() throws TypeError
     112    {
     113        throw new TypeError(this, "number");
     114    }
     115
    111116    public int length() throws LispError
    112117    {
  • trunk/j/src/org/armedbear/lisp/Ratio.java

    r3336 r3341  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: Ratio.java,v 1.13 2003-08-11 18:40:12 piso Exp $
     5 * $Id: Ratio.java,v 1.14 2003-08-12 02:06:34 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    101101    }
    102102
     103    public LispObject ZEROP()
     104    {
     105        return NIL;
     106    }
     107
    103108    public float floatValue()
    104109    {
Note: See TracChangeset for help on using the changeset viewer.