Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: ade@world.std.com (Lee A Beaudette)
Subject: Re: Help: Any VAX floating point emulation lib. for non-VAX
Date: Thu, 1 Sep 1994 11:13:11 GMT	[thread overview]
Message-ID: <CvG760.EB2@world.std.com> (raw)

Ken,

Thank you very much, you are right. I'm using MS-VC++1.0. I could not find the
way to match the IEEE with VC++ and MS-Japan rep. said there is no option to do
that. However Borland C++ 3.1 has the option "Fast floating point", its help
says "When this option is off, the compiler follows strict ANSI rules regarding
floating-point conversion". After turned off this option, I got the exact same
results with VAX on PC.

Example :

#define PI  3.14159265358979323846264338327950288

int main()
{
	int i = 100;
	double b;

	b = cos((float)(PI * 0.5));
	printf("%20.10lf\n", b);

	b = cos((float)(2.0 * PI * i / 400));
	printf("%20.10lf\n", b);
}

VAX, BC(FFP off) print
       -0.0000000437
       -0.0000000437

BC(FFP on), VC(emu, inline) print
       -0.0000000437
        0.0000000000

VC(80x87, co-pro) print
        0.0000000000
       -0.0000000000

Again, thank you very much. For short term, I could switch to BC++ from VC++,
but I still need to go VC++ sometime. Any idea ?

Hisa Noguchi
KYD00035@niftyserve.or.jp



                 reply	other threads:[~1994-09-01 11:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox