Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!occrsh!uokmax!jkmedcal From: jkmedcal@uokmax.UUCP (Jeff K Medcalf) Newsgroups: comp.lang.pascal Subject: Re: complex numbers Message-ID: <3495@uokmax.UUCP> Date: 15 Jul 89 19:36:24 GMT References: <2751@ohstpy.mps.ohio-state.edu> Reply-To: jkmedcal@uokmax.UUCP (Jeff K Medcalf) Organization: No, it isn't really. Lines: 33 In article <2751@ohstpy.mps.ohio-state.edu> heff@ohstpy.mps.ohio-state.edu writes: >Is there an easy way to do complex numbers in pascal? In particular is >there a way to write equations in source code such as > a =: b + c; >or > a := (b+c)/(d+e); Well, one way (not quite this easy) would by to declare a type complex_number = record re : real; im : real end; {complex_number} var a, b, c, d, e : complex_number; and then a.re := b.re + c.re; a.im := b.im + c.im; or a.re := (b.re + c.re)/(d.re + e.re); a.im := (b.im + c.im)/(d.im + e.im); Perhaps not as simple as you want, but it does work well. -- I dream I'm safe jkmedcal@uokmax.UUCP In my hotel womb Jeff Medcalf Soft and so nice It's a wonderful womb <-The Church, "Hotel Womb"