Complex functions -- hacking "Float"

Martin Snelgrove snelgar at dissonance.com
Sat Oct 1 04:17:26 UTC 2005


I'm looking at Smalltalk for some control systems work, for which  
Complex is essential (plus plenty of other stuff).
I just sent in arcSin etc for Complex, which is probably  
uncontroversial. What I plan to do next, though, is probably
easy to get wrong. For my use, anyway, Float needs to work nicely  
with Complex, and in particular lots of functions
that return FloatingPointException and such at the moment should  
return Complex.

The obvious example is "-1 sqrt", which I plan to have return "1 i",  
but most of the mathematical functions will change.
I propose only to touch the cases that currently return errors.

Is there any obvious reason not to do this? I assume that programs  
aren't being written to rely on the error returns,
for example.
     regards
         ws




More information about the Squeak-dev mailing list