Changeset 8756


Ignore:
Timestamp:
03/12/05 17:08:23 (16 years ago)
Author:
piso
Message:

truncate(): support rational arguments.

File:
1 edited

Legend:

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

    r8753 r8756  
    33 *
    44 * Copyright (C) 2003-2005 Peter Graves
    5  * $Id: LispFloat.java,v 1.83 2005-03-12 15:57:01 piso Exp $
     5 * $Id: LispFloat.java,v 1.84 2005-03-12 17:08:23 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    408408            return thread.setValues(result, remainder);
    409409        }
     410        if (obj instanceof Ratio) {
     411            // "When rationals and floats are combined by a numerical function,
     412            // the rational is first converted to a float of the same format."
     413            // 12.1.4.1
     414            return truncate(new LispFloat(((Ratio)obj).floatValue()));
     415        }
    410416        return signal(new LispError("LispFloat.truncate(): not implemented: " +
    411417                                    obj.typeOf().writeToString()));
Note: See TracChangeset for help on using the changeset viewer.