Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: math in Lattice Message-ID: Date: 24 Aug 90 14:17:41 GMT References: <90233.133801KELLYDK@QUCDN.BITNET> Lines: 30 In article <90233.133801KELLYDK@QUCDN.BITNET> KELLYDK@QUCDN.QueensU.CA (Doug Kelly) writes: > >I'm porting some numerical code from a PC to an IBM RS/6000 and, >since I hate telnet, I 'ANSI'd' the program on my Amiga, and then >recompiled it on the 6000. Here's the problem - the Amiga version >gives the wrong results!! The program compiles fine, runs to >completion with no errors, but the results are wrong. THE SAME CODE >runs on both the pc (Turbo) and the 6000. >I'm using Lattice 5.02 (I know it's old). I've tried all three >math formats - ffp, ieee and inline 881 and none of them come out right. Use the strict prototype checking option under Lattice. These kinds of problems are usually related to forgetting to prototype *every* instance of the function and/or forgetting to prototype the function itself. Unprototyped functions/calls that take floats actually take doubles. prototyped functions/calls take the appropriate type, float or double. It depends on the compiler, perhaps the PC's do not implement this aspect of prototyping completely (which isn't wrong, just not efficient). -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA