Complex numbers (was Re: Roadmap proposal for 3.10/4.0)
Bert Freudenberg
bert at freudenbergs.de
Tue Oct 17 09:52:52 UTC 2006
Am 17.10.2006 um 03:45 schrieb Ken Dickey:
> Greetings,
>
> I'd like to raise the idea of changing the complex number code in
> 3.10/4.0.
>
> See change set at:
> http://bugs.impara.de/view.php?id=3311
>
>
> Current (3.8/3.9):
> 2i isNumber. "false"
> -4 ln. "NaN"
> -4 sqrt. "exception"
>
> Alternate Code:
> 2i isNumber. "true"
> -4 ln. "(1.38629436111989 +3.141592653589793i)"
> -4 sqrt. "2.0i"
>
>
> I consider this a "community issue".
>
> Questions:
> - Are there users of complex numbers (does anyone care)?
> - Assuming yes, are there objective criteria for choosing between
> alternate
> implementations?
> + behavior/completeness/test-cases
> + performance (I suspect that "the wrong answer fast" is not the
> Smalltalk
> way as we can always augment the primOps)
> + complex number user community vote
> + other...?
>
> I am actually agnostic as to which code base gets chosen, but we
> really should
> get the answers right.
Well, in best Smalltalk tradition I would vote for the alternate
code. It's similar to fractional arithmetic ( 3 / 4 ). Yes, fractions
bite some newbies, but they learn to use #// or #asFloat fast enough.
Same here - if you need an error when taking a negative's square
root, send #asFloat.
It's also a bit similar to Smalltalk being one of the few systems
with correct integers, where a bug like this is not possible:
http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-
it-nearly.html
I'd like to have no arbitrary limits, like forbidding to take the
logarithm of negative numbers.
- Bert -
More information about the Squeak-dev
mailing list
|