From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,697e95a9812ad364,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-08-31 11:05:59 PST Newsgroups: comp.sys.dec Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!zip.eecs.umich.edu!newsxfer.itd.umich.edu!gatech!swrinde!ihnp4.ucsd.edu!dog.ee.lbl.gov!overload.lbl.gov!lll-winken.llnl.gov!unixhub!slacvx.slac.stanford.edu!fairfield From: fairfield@slacvx.slac.stanford.edu Subject: Re: Help: Any VAX floating point emulation lib. for non-VAX machine Message-ID: <1994Aug31.095400.1@slacvx.slac.stanford.edu> Sender: news@unixhub.SLAC.Stanford.EDU Organization: Stanford Linear Accelerator Center References: Date: Wed, 31 Aug 1994 17:54:00 GMT In article , jg1ifj@world.std.com (Hisa Noguchi) writes: > Does anyone know of the any VAX floating point emulation library for non-VAX > system (esp. for PC). > > I'm porting a VAX program to PC which using a single precision floating point > in many places. Because of the FPU differences, VAX and PC give different > rounding error. It is not negligible for the single precision for this app. > Unfortunately I can't modify VAX program (out of my control) to use double > precision to reduce the differences. > > Speed is not issue this time, but the target is to get a same (almost) data > without modifying the VAX program. > > It is a common practices to emulate x87 FPU for the x86sx machines. I hope > somebody has similar library for VAX floating point. Right ? > > Any help, suggestion or info. would be appreciated. Since a VAX F_float (single precision floating point) has the same precision as an IEEE Single (used by Intel processors), and since the VAX and IEEE singles have _almost_ the same range, you shouldn't (in principle) have to do anything. However, the Intel, especially if you have a math co-processor, is likely to keep more precision in the intermediate results, and I would expect that is the difference you are seeing. I believe there is a way to get your compiler (you didn't say which language) to truncate or round intermediate results back to single precision. That should reproduce the VAX results... -Ken -- Dr. Kenneth H. Fairfield | Internet: Fairfield@Slac.Stanford.Edu SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX) Stanford, CA 94309 | Voice: (415) 926-2924 FAX: (415) 926-4335 ---------------------------------------------------------------------------- These opinions are mine, not SLAC's, Stanford's, nor the DOE's...