Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!orion.cf.uci.edu!ggiergiel@vmsa.cf.uci.edu From: ggiergiel@vmsa.cf.uci.edu Newsgroups: comp.sys.mac.programmer Subject: beauty of TMLPascal 1.0.3 Message-ID: <2205@orion.cf.uci.edu> Date: 7 Jul 89 18:20:09 GMT Sender: news@orion.cf.uci.edu Lines: 30 Version 1.0.3 of TMLPascal running under MPW 2.0.2 generates incorrect code for the following source: Type complex = structure r:extended; i:extended; end; var a,b,d :complex; begin ... CMult(c,b,a); ... end; Procedure CMult(Var z:complex; Var y:complex; Var x:complex); Begin z.r:=x.r*x.r - y.i*y.i; z.i:=x.r*y.i + x.i*y.r; end; The correct code will be generated if calculation of z.r and z.i is split into two lines (multiply first and add later). Obviously I gave up on using TMLPascal. At a minimum one would want to see compilers to be able to add and multiply numbers correctly. JGiergiel GGIERGIEL@UCIVMSA.