equal
deleted
inserted
replaced
19 |
19 |
20 SmallInteger comment:' |
20 SmallInteger comment:' |
21 COPYRIGHT (c) 1988 by Claus Gittinger |
21 COPYRIGHT (c) 1988 by Claus Gittinger |
22 All Rights Reserved |
22 All Rights Reserved |
23 |
23 |
24 $Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.23 1995-02-26 18:14:08 claus Exp $ |
24 $Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.24 1995-03-09 09:45:46 claus Exp $ |
25 '! |
25 '! |
26 |
26 |
27 !SmallInteger class methodsFor:'documentation'! |
27 !SmallInteger class methodsFor:'documentation'! |
28 |
28 |
29 copyright |
29 copyright |
40 " |
40 " |
41 ! |
41 ! |
42 |
42 |
43 version |
43 version |
44 " |
44 " |
45 $Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.23 1995-02-26 18:14:08 claus Exp $ |
45 $Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.24 1995-03-09 09:45:46 claus Exp $ |
46 " |
46 " |
47 ! |
47 ! |
48 |
48 |
49 documentation |
49 documentation |
50 " |
50 " |
328 RETURN ( ((double)_intVal(self) <= _floatVal(aNumber)) ? true : false ); |
328 RETURN ( ((double)_intVal(self) <= _floatVal(aNumber)) ? true : false ); |
329 } |
329 } |
330 %} |
330 %} |
331 . |
331 . |
332 ^ self retry:#<= coercing:aNumber |
332 ^ self retry:#<= coercing:aNumber |
|
333 ! |
|
334 |
|
335 hash |
|
336 "return an integer useful for hashing on value" |
|
337 |
|
338 self >= 0 ifTrue:[^ self]. |
|
339 ^ self negated |
333 ! |
340 ! |
334 |
341 |
335 identityHash |
342 identityHash |
336 "return an integer useful for hashing on identity" |
343 "return an integer useful for hashing on identity" |
337 |
344 |
1352 |
1359 |
1353 _qMKFLOAT(newFloat, (double)_intVal(self), SENDER); |
1360 _qMKFLOAT(newFloat, (double)_intVal(self), SENDER); |
1354 /* |
1361 /* |
1355 _qNew(newFloat, sizeof(struct floatstruct), SENDER); |
1362 _qNew(newFloat, sizeof(struct floatstruct), SENDER); |
1356 if (newFloat != nil) { |
1363 if (newFloat != nil) { |
1357 _InstPtr(newFloat)->o_class = Float; |
1364 _InstPtr(newFloat)->o_class = Float; |
1358 _FloatInstPtr(newFloat)->f_floatvalue = _intVal(self); |
1365 _FloatInstPtr(newFloat)->f_floatvalue = _intVal(self); |
1359 } |
1366 } |
1360 */ |
1367 */ |
1361 RETURN ( newFloat ); |
1368 RETURN ( newFloat ); |
1362 %} |
1369 %} |
1363 ! |
1370 ! |
1652 __thisContext = sav; |
1659 __thisContext = sav; |
1653 #endif |
1660 #endif |
1654 sz = sizeof(struct stringheader) + strlen(buffer) + 1; |
1661 sz = sizeof(struct stringheader) + strlen(buffer) + 1; |
1655 _qNew(newString, sz, SENDER); |
1662 _qNew(newString, sz, SENDER); |
1656 if (newString != nil) { |
1663 if (newString != nil) { |
1657 _InstPtr(newString)->o_class = String; |
1664 _InstPtr(newString)->o_class = String; |
1658 strcpy(_stringVal(newString), buffer); |
1665 strcpy(_stringVal(newString), buffer); |
1659 RETURN (newString); |
1666 RETURN (newString); |
1660 } |
1667 } |
1661 %}. |
1668 %}. |
1662 ^ super printString |
1669 ^ super printString |
1663 ! |
1670 ! |
1664 |
1671 |