pharo
pharo copied to clipboard
Improve comments of clampBetween:and:
clampBetween: min and: max
"Return the receiver if between min and max, else the min or max closest to the receiver."
"(1 clampBetween: 10 and: 20) >>> 10"
"(15 clampBetween: 10 and: 20) >>> 15"
"(25 clampBetween: 10 and: 20) >>> 20"
(self between: min and: max)
ifTrue: [ ^ self ]
ifFalse: [ self < min ifTrue: [ ^ min ] ].
^ max
i want to work on this issue.