Changeset 9069


Ignore:
Timestamp:
05/06/05 12:41:04 (16 years ago)
Author:
piso
Message:

ATAN: type checking.

File:
1 edited

Legend:

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

    r8938 r9069  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: MathFunctions.java,v 1.18 2005-04-16 14:58:41 piso Exp $
     5 * $Id: MathFunctions.java,v 1.19 2005-05-06 12:41:04 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    177177        public LispObject execute(LispObject arg) throws ConditionThrowable
    178178        {
    179             return atan(arg);
     179            if (arg.numberp())
     180                return atan(arg);
     181            return signal(new TypeError(arg, Symbol.NUMBER));
    180182        }
    181183
     
    183185            throws ConditionThrowable
    184186        {
     187            if (!first.realp())
     188                return signal(new TypeError(first, Symbol.REAL));
     189            if (!second.realp())
     190                return signal(new TypeError(second, Symbol.REAL));
    185191            return atan(first.divideBy(second));
    186192        }
Note: See TracChangeset for help on using the changeset viewer.