!Integer methodsFor: 'built ins'! / arg " " (arg isMemberOf: Integer) & (self isMemberOf: Integer) ifTrue: [ ^(Fraction numerator: self denominator: arg)]. ^self retry: #/ coercing: arg !! !Integer methodsFor: 'converting'! asFraction ^Fraction numerator: self denominator: 1 !! !Number methodsFor: 'truncation and round off'! floor "Return the integer nearest the receiver toward negative infinity." | selfTruncated | selfTruncated _ self truncated. "If positive, truncation to zero is what we want." self >= 0 ifTrue: [^selfTruncated]. "Must be negative." self = selfTruncated ifTrue: [^selfTruncated] ifFalse: [^selfTruncated - 1] !! !Number methodsFor: 'arithmetic'! reciprocal self = 0 ifTrue: [self error: 'can not return the reciprocal of zero'] ifFalse: [^1 / self] !!