Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.250.mcz ==================== Summary ==================== Name: Kernel-nice.250 Author: nice Time: 25 September 2009, 10:47:10 am UUID: ae2ecb83-4bd9-fd4d-abf8-2b02d30ba0a9 Ancestors: Kernel-ar.249 Fix nan comparison from http://bugs.squeak.org/view.php?id=6719 Note: the fix does use adpatToXXX:andSend: instead of proposed adpatToXXX:andCompare: This way, it is independant of http://bugs.squeak.org/view.php?id=3374 (I don't want to fight now with lengthy argumentation) =============== Diff against Kernel-ar.249 =============== Item was added: + ----- Method: Fraction>>>= (in category 'comparing') ----- + >= aNumber + aNumber isFraction ifTrue: + [^ numerator * aNumber denominator >= (aNumber numerator * denominator)]. + ^ aNumber adaptToFraction: self andSend: #>=! Item was added: + ----- Method: Fraction>><= (in category 'comparing') ----- + <= aNumber + aNumber isFraction ifTrue: + [^ numerator * aNumber denominator <= (aNumber numerator * denominator)]. + ^ aNumber adaptToFraction: self andSend: #<=! Item was added: + ----- Method: ScaledDecimal>>> (in category 'comparing') ----- + > operand + "Implementation of Number 'comparing' method." + (operand isKindOf: ScaledDecimal) ifTrue: [^ fraction > operand asFraction]. + ^ operand adaptToScaledDecimal: self andSend: #>! Item was added: + ----- Method: Fraction>>> (in category 'comparing') ----- + > aNumber + aNumber isFraction ifTrue: + [^ numerator * aNumber denominator > (aNumber numerator * denominator)]. + ^ aNumber adaptToFraction: self andSend: #>! Item was added: + ----- Method: Integer>><= (in category 'comparing') ----- + <= aNumber + aNumber isInteger ifTrue: + [self negative == aNumber negative + ifTrue: [self negative + ifTrue: [^ (self digitCompare: aNumber) >= 0] + ifFalse: [^ (self digitCompare: aNumber) <= 0]] + ifFalse: [^ self negative]]. + ^ aNumber adaptToInteger: self andSend: #<=! Item was changed: ----- Method: Magnitude>>>= (in category 'comparing') ----- >= aMagnitude "Answer whether the receiver is greater than or equal to the argument." + ^aMagnitude <= self! - ^(self < aMagnitude) not! Item was added: + ----- Method: ScaledDecimal>>>= (in category 'comparing') ----- + >= operand + "Implementation of Number 'comparing' method." + (operand isKindOf: ScaledDecimal) ifTrue: [^ fraction >= operand asFraction]. + ^ operand adaptToScaledDecimal: self andSend: #>=! Item was added: + ----- Method: Integer>>>= (in category 'comparing') ----- + >= aNumber + aNumber isInteger ifTrue: + [self negative == aNumber negative + ifTrue: [self negative + ifTrue: [^(self digitCompare: aNumber) <= 0] + ifFalse: [^(self digitCompare: aNumber) >= 0]] + ifFalse: [^ aNumber negative]]. + ^ aNumber adaptToInteger: self andSend: #>=! Item was added: + ----- Method: ScaledDecimal>><= (in category 'comparing') ----- + <= operand + "Implementation of Number 'comparing' method." + (operand isKindOf: ScaledDecimal) ifTrue: [^ fraction <= operand asFraction]. + ^ operand adaptToScaledDecimal: self andSend: #<=! |
Free forum by Nabble | Edit this page |