Changeset 12951
- Timestamp:
- 10/04/10 13:11:12 (12 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/Ratio.java
r12288 r12951 182 182 public float floatValue() 183 183 { 184 float result = (float) doubleValue(); 185 if (Float.isInfinite(result) && TRAP_OVERFLOW) 186 type_error(this, Symbol.SINGLE_FLOAT); 187 184 188 return (float) doubleValue(); 185 189 } … … 218 222 d = d.shiftRight(1); 219 223 } 224 if (Double.isInfinite(result) && TRAP_OVERFLOW) 225 type_error(this, Symbol.DOUBLE_FLOAT); 226 220 227 return negative ? -result : result; 221 228 } -
trunk/abcl/src/org/armedbear/lisp/SingleFloat.java
r12535 r12951 630 630 if (obj instanceof SingleFloat) 631 631 return (SingleFloat) obj; 632 if (obj instanceof DoubleFloat) 633 return new SingleFloat((float)((DoubleFloat)obj).value); 632 if (obj instanceof DoubleFloat) { 633 float result = (float)((DoubleFloat)obj).value; 634 if (Float.isInfinite(result) && TRAP_OVERFLOW) 635 type_error(obj, Symbol.SINGLE_FLOAT); 636 637 return new SingleFloat(result); 638 } 634 639 if (obj instanceof Bignum) 635 640 return new SingleFloat(((Bignum)obj).floatValue());
Note: See TracChangeset
for help on using the changeset viewer.