Re: s29 and Complex numbers

2006-02-28 Thread Jonathan Lang
Doug McNutt wrote: > Jonathan Lang wrote: > >Technically, the result set is one element (the principle value), > >since a mathematical function - by definition - produces a single > >result for any given input. > > Please be careful of "definitions" like that. Computer science has quite > differen

Re: s29 and Complex numbers

2006-02-28 Thread Doug McNutt
At 09:33 -0800 2/28/06, Jonathan Lang wrote: >Technically, the result set is one element (the principle value), >since a mathematical function - by definition - produces a single >result for any given input. Please be careful of "definitions" like that. Computer science has quite different ideas

Re: s29 and Complex numbers

2006-02-28 Thread Jonathan Lang
Mark A. Biggar wrote: > For the complex trig functions the result set is infinite with no > obvious order to return the list in even lazily that provides anything > useful. Technically, the result set is one element (the principle value), since a mathematical function - by definition - produces a

Re: s29 and Complex numbers

2006-02-28 Thread Mark A. Biggar
David Green wrote: On 2/23/06, Jonathan Lang wrote: (Another possibility would be to return a list of every possible result when in list context, with the result that you'd get in scalar context being element zero of the list. This even has its uses wrt sqrt(Num), providing a two-element lis

Re: s29 and Complex numbers

2006-02-28 Thread David Green
On 2/23/06, Jonathan Lang wrote: (Another possibility would be to return a list of every possible result when in list context, with the result that you'd get in scalar context being element zero of the list. This even has its uses wrt sqrt(Num), providing a two-element list of the positive an

s29 and Complex numbers

2006-02-23 Thread Jonathan Lang
If you're going to have versions of sqrt in S29 that deal with Complex numbers, you ought to do likewise with a number of other functions: multi sub abs (: Complex ?$x = $CALLER::_ ) returns Num should return the magnitude of a complex number. abs($x) := $x.magnitude, or whatever the appropriat