[BUG] Complex equality problem ([closed] already on Mantis ID
2688)
Ken Causey
ken at kencausey.com
Wed Feb 8 22:05:37 UTC 2006
http://bugs.impara.de/view.php?id=2688
On Wed, 2006-02-08 at 00:19 +0100, nicolas cellier wrote:
> Testing equality
> aNumber = (aNumber + 0 i)
> will answer false...
>
> Testing equality
> (aNumber + 0 i) = aNumber
> will answer true...
>
> (1 + 0 i) = 1.
> 1 = (1 + 0 i).
>
> This is due to premature test
> isNumber ifFalse [^false].
>
> Obviously, Complex cannot answer true to isNumber because most senders of this
> message will trust faithfully isKindOf: Number, and Complex is not in this
> hierarchy.
>
> The test should be some sort of
> isArithmeticValue ifFalse: [^false]
> and Complex Quaternion and other arithmetic classes extending numbers should
> answer true to isArithmeticValue.
>
> This is another clue that VW ArithmeticValue superclass of Number make sense.
> And another clue that Complex (ComplexNumber please) are not much used.
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060208/ced279b9/attachment.pgp
More information about the Squeak-dev
mailing list
|