Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!bloom-beacon!think!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Endless inSANEity... Message-ID: <2089@husc6.harvard.edu> Date: 20 Jun 89 03:29:41 GMT References: <227700009@uxa.cso.uiuc.edu> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec/THINK Technologies, Bedford, MA Lines: 55 In article <227700009@uxa.cso.uiuc.edu> cjr20670@uxa.cso.uiuc.edu writes: > All the floating numbers are using this struct at present: > >typedef struct > { > double sn; /* SANE number */ > Fixed fx; /* Fixed number */ > } aNum; > > So that's the first big problem, how do I put the 881 "double" in the >same struct? They're both called double, but one is 12 bytes and the other >is 10 bytes. I can't specify one without the other. Gggrrrrr. You could put 96-bit doubles in your struct by typedef'ing them as a 12-character array, or three longs. (This is assuming non-881 code generation.) > If someone can help me with that problem, I've got another one for ya. >Is there anyway I can use both the Math and Math881 libraries in the SAME >project without renaming the needed functions in one of the libraries? Nope. The current design of the linker doesn't allow multiple or overriding routine definitions, and at any rate, how would you know which routines to call? > Anyone with experience in mixing oil and water, please help! Mixing 80- and 96-bit arithmetic in the same program is not something to be undertake lightly, if at all. You might consider two copies of your program - one for SANE use, one for direct 881 use. In My Humble Opinion, someone Screwed Up when making doubles to be 80 bits. Motorola has some moderately reasonable reason for making the IEEE Extended type a 12-byte type, to wit, longword alignment. I think the SANE interfaces could have been designed this way, but it's kind of too late.... GDraw is a nifty program. If you haven't seen it, take a look. --Rich ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel I classify myself as a real developer because my desk is hip-deep in assembly-language listings and I spend more than 50% of my time in TMON. ~~~~~~~~~~~~~~~