| Anonymous | Login | Signup for a new account | 02-09-2010 12:32 UTC |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0003725 | [Squeak] Kernel | minor | always | 05-26-06 17:55 | 07-15-06 12:06 | ||||
| Reporter | DF | View Status | public | ||||||
| Assigned To | |||||||||
| Priority | normal | Resolution | duplicate | ||||||
| Status | closed | Product Version | 3.9 | ||||||
| Summary | 0003725: [FIX] ComplexTest>>testEquality | ||||||||
| Description |
The change set included with this bug report fixes ComplexTest>>testEquality Note that the proposed changes need further discussion. The changes adds #isNumber to Complex, to respond true (this is needed for: 1 = (1 + 0i) ). And in #= anObject sends #adaptToComplex:andSend: only if anObject is a number (this is needed for: (1 + 0i) = nil). Problems: - In the previous version: (1 + 0i) = (Array with: (1 + 0i)) is true because #= in complex sends #adaptToComplex:andSend: to any object that is not a Complex (but this fails with other classes because #adaptToComplex:andSend: is not implemented in Object). I think that Collection>>adaptToComplex:andSend: should not exists. - After applying the change set Complex>>isNumber returns true but Complex is not in the hierarchy of Number. I think that a Complex is a Number, so it must be in the Number hierarchy. Maybe Number asumes that numbers are comparable (<,>) and Complex cannot be compared, in that case should be another super class... something like ArithmeticValue or ArithmeticObject |
||||||||
| Additional Information | |||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
Relationships |
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
Notes |
|
|
(0005139 - 654 - 732 - 1110 - 1110 - 1110 - 1110) nicolas cellier 05-31-06 00:05 edited on: 05-31-06 00:07 |
Hi Yes Complex is a Number, but see all senders of #isNumber and you will see that this might potentially break a lot of code. In this case, we would need to replace #isNumber with more specialized #isRealNumber... Note that #isComplexNumber is better than #isComplex that is also implemented elsewhere ( see http://bugs.impara.de/view.php?id=2689 [^] ). I proposed another fix for complex equality bug at http://bugs.impara.de/view.php?id=2688 [^] I proposed using #isNumberExtension, which can be true for Number, Complex, Quaternion... But i was not particularily proud of the name. You can also browse http://bugs.impara.de/view.php?id=3540 [^] |
|
(0005140 - 482 - 518 - 770 - 770 - 770 - 770) nicolas cellier 05-31-06 00:15 |
Also note that Number equality testing does suffer from other problems ( see http://bugs.impara.de/view.php?id=3374 [^] ), for which i also proposed some fix. Yet i did not merge with complex equality fixes. See also http://bugs.impara.de/view.php?id=3360 [^] I did not catch Array equality problem, but yes, Array can implement #adaptToComplex:andSend: if we want to do array arithmetic... Why would we do array arithmetic with real numbers and wouldn't we with complex numbers ? |
|
(0005932 - 9 - 9 - 9 - 9 - 9 - 9) MarcusDenker 07-15-06 12:06 |
duplicate |
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
76 total queries executed. 47 unique queries executed. |