Changeset 11579


Ignore:
Timestamp:
01/24/09 10:24:34 (13 years ago)
Author:
ehuelsmann
Message:

Add floatValue() and doubleValue() to LispObject and all number classes which didn't have it yet.

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

Legend:

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

    r11574 r11579  
    263263  }
    264264
     265  @Override
    265266  public float floatValue() throws ConditionThrowable
    266267  {
     
    272273  }
    273274
     275  @Override
    274276  public double doubleValue() throws ConditionThrowable
    275277  {
  • trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java

    r11573 r11579  
    242242
    243243    @Override
     244    public double doubleValue() {
     245        return value;
     246    }
     247
     248    @Override
    244249    public Object javaInstance()
    245250    {
  • trunk/abcl/src/org/armedbear/lisp/Fixnum.java

    r11574 r11579  
    310310        return 0;
    311311      }
     312  }
     313
     314  @Override
     315  public float floatValue() {
     316    return (float)value;
     317  }
     318
     319  @Override
     320  public double doubleValue() {
     321    return (double)value;
    312322  }
    313323
  • trunk/abcl/src/org/armedbear/lisp/LispObject.java

    r11573 r11579  
    776776  }
    777777
     778  public float floatValue() throws ConditionThrowable
     779  {
     780    type_error(this, Symbol.SINGLE_FLOAT);
     781    // Not reached
     782    return 0;
     783  }
     784
     785  public double doubleValue() throws ConditionThrowable
     786  {
     787    type_error(this, Symbol.DOUBLE_FLOAT);
     788    // Not reached
     789    return 0;
     790  }
     791
    778792  public LispObject incr() throws ConditionThrowable
    779793  {
  • trunk/abcl/src/org/armedbear/lisp/Ratio.java

    r11488 r11579  
    183183    }
    184184
     185    @Override
    185186    public float floatValue()
    186187    {
     
    188189    }
    189190
     191    @Override
    190192    public double doubleValue()
    191193    {
  • trunk/abcl/src/org/armedbear/lisp/SingleFloat.java

    r11573 r11579  
    242242
    243243    @Override
     244    public float floatValue() {
     245        return value;
     246    }
     247
     248    @Override
     249    public double doubleValue() {
     250        return value;
     251    }
     252
     253    @Override
    244254    public Object javaInstance()
    245255    {
Note: See TracChangeset for help on using the changeset viewer.