#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 15 Jun 2017 13:57:50 +0200
changeset 21821 8ddbf4a3816f
parent 21820 3825bcd2e2c7
child 21822 7f00cd69b534
#FEATURE by cg class: SmallInteger class added: #coerce:
SmallInteger.st
--- a/SmallInteger.st	Thu Jun 15 13:57:31 2017 +0200
+++ b/SmallInteger.st	Thu Jun 15 13:57:50 2017 +0200
@@ -113,6 +113,14 @@
     ZeroString := '0'
 ! !
 
+!SmallInteger class methodsFor:'coercing & converting'!
+
+coerce:aNumber
+    "convert the argument aNumber into an instance of the receiver's class and return it."
+
+    ^ aNumber asInteger
+! !
+
 !SmallInteger class methodsFor:'constants'!
 
 maxBits
@@ -1000,7 +1008,6 @@
 ! !
 
 
-
 !SmallInteger methodsFor:'bit operators'!
 
 bitAnd:anInteger