[comp.lang.forth] complex number conventions

kallaus@leadsv.UUCP (Jerry Kallaus) (03/03/89)

I would be intereseted in any information anyone here can provide
regarding representation of complex numbers in Forth.  Specifically,
if there exists much in the way of conventions for the ordering
of the (real,imaginary) pair in memory and on the stack.

For the work I'm doing, I would like to stick with the convention
of having the real part of the (real,imag) pair at the lower
memory address for variables and arrays.

For the stack, I was originally using the convention of having the
real part on top of the stack, with the imaginary part underneath it.
I'm using an Amiga JForth with Object Development Environment (ODE).
I decided that it would be more consistant with the way that ODE
moves data between the stack and objects to use the convention of
having the imaginary part on top of the stack with the real
part underneath.  One of the problems I have with this convention
is that it seems inconsistant with the way JForth handles multiple
cell "local variables".

Any comments on this would be appreciated.
-- 
Jerry Kallaus         {pyramid.arpa,ucbvax!sun!suncal}leadsv!kallaus
(408)742-4569
     "Funny, how just when you think life can't possibly get
      any worse, it suddenly does." - Douglas Adams