On Tue, 2007-05-01 at 21:06 -0400, Chris King wrote: > On 5/1/07, skaller <[EMAIL PROTECTED]> wrote: > > In principle I think 'complex' and 'complex with infinity' > > are different types, but then complex+inf only has ONE > > infinity, quite different from 'number too large' which > > might retain a phase angle. > > Infinity+phase angle is different than "number too large"+phase... > infinity+phase angle is needed so identities such as angle(K*x) === > angle(x) to hold when the scalar K "equals" infinity. (I use "equals" > here in the IEEE-754 sense.) But certainly I agree that a complex > type where infinities are disallowed (and 1/0 raises an exception) > would be useful. > > > Felix doesn't box products :) > > Well, you need at least one bit to store the polar/Cartesian flag, > which means an extra word in the representation, which means a > structure of odd size... but in polar form we only need a subset of > the range available in an IEEE double (only positive magnitudes, > -pi:pi angle) so maybe we can do some trickery there to shove > everything into two doubles...
You'd use distinct types I think. Consider a matrix of 100 * 100 elements -- the whole matrix would either be polar or cartesian surely, not individual elements. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language