* DU-Linux binary compatibility:rounding mode
@ 1997-11-18 13:31 Claus Denk
0 siblings, 0 replies; only message in thread
From: Claus Denk @ 1997-11-18 13:31 UTC (permalink / raw)
Hi,
I have just run across a "compatibility" problem when running DU
binaries on Linux.
The following program:
1 #include <math.h>
2 #include <float.h>
3 #include <stdio.h>
4 int main() {
5 #ifdef DYNAMIC_ROUND
6 write_rnd(FP_RND_RN);
7 #endif
8 printf("rint(0.8)=%e\n",rint(0.8));
9 return 0;
10 }
1) compiled on DU with the flags:
cc round.c -lm -non_shared
gives on DU:
rint(0.8)=1.000000e+00
gives on Linux:
rint(0.8)=0.000000e+00
2) compiled on DU with the flags:
cc round.c -DDYNAMIC_ROUND -fprm d -lm -non_shared
gives on DU:
rint(0.8)=1.000000e+00
gives on Linux:
rint(0.8)=1.000000e+00
The cc manual states that the default rounding behaviour for method 1)
is -frpm n (normal rounding mode to closest integer). This works on DU
but fails on Linux. Programs compiled on DU that use this "static"
rounding mode (method 1) will fail on Linux. Is this a Kernel problem ?
Any ideas ?
regards, Claus
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-11-18 13:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-11-18 13:31 DU-Linux binary compatibility:rounding mode Claus Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox