* Re: Help: Any VAX floating point emulation lib. for non-VAX
@ 1994-09-01 11:13 Lee A Beaudette
0 siblings, 0 replies; only message in thread
From: Lee A Beaudette @ 1994-09-01 11:13 UTC (permalink / 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1994-09-01 11:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-09-01 11:13 Help: Any VAX floating point emulation lib. for non-VAX Lee A Beaudette
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox