'From Squeak2.9alpha of 13 June 2000 [latest update: #2440] on 13 August 2000 at 12:26:15 pm'! !Number methodsFor: 'truncation and round off' stamp: 'RAH 4/25/2000 19:49'! truncateTo: factor "Answer the next multiple of factor toward zero that is nearest the receiver. " #Numeric. "Changed 200/01/19 For ANSI to return correct type." " ^(self quo: aNumber) * aNumber" ^ (self asSpecies: (self quo: factor)) * factor"<- Chg"! ! !Number methodsFor: 'converting' stamp: 'RAH 4/25/2000 19:49'! roundTo: factor "Answer the nearest number that is a multiple of factor." #Numeric. "Changed 200/01/19 For ANSI to return correct type, and factor = 0." factor = 0 ifTrue: ["<- Chg" ^ (ZeroDivide dividend: self) signal"<- Chg"]. "<- Chg" ^ (self asSpecies: (self / factor) rounded) * factor"<- Chg"! !