equal
deleted
inserted
replaced
415 |
415 |
416 asInteger |
416 asInteger |
417 "return an integer with same value - might truncate" |
417 "return an integer with same value - might truncate" |
418 |
418 |
419 %{ /* NOCONTEXT */ |
419 %{ /* NOCONTEXT */ |
420 |
420 double dVal; |
421 if ((__floatVal(self) >= (double)_MIN_INT) |
421 |
422 && (__floatVal(self) <= (double)_MAX_INT)) { |
422 dVal = __floatVal(self); |
423 RETURN ( __MKSMALLINT( (INT)__floatVal(self)) ); |
423 if ((dVal >= (double)_MIN_INT) && (dVal <= (double)_MAX_INT)) { |
|
424 RETURN ( __MKSMALLINT( (INT)dVal) ); |
424 } |
425 } |
425 %}. |
426 %}. |
426 ^ super asInteger |
427 ^ super asInteger |
427 |
428 |
428 "12345.0 asInteger" |
429 "12345.0 asInteger" |
1088 ! ! |
1089 ! ! |
1089 |
1090 |
1090 !Float class methodsFor:'documentation'! |
1091 !Float class methodsFor:'documentation'! |
1091 |
1092 |
1092 version |
1093 version |
1093 ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.40 1996-07-18 10:31:03 cg Exp $' |
1094 ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.41 1996-09-20 22:47:43 cg Exp $' |
1094 ! ! |
1095 ! ! |