Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Claus Denk <denk@cica.es>
Subject: DU-Linux binary compatibility:rounding mode
Date: Tue, 18 Nov 1997 14:31:40 +0100	[thread overview]
Message-ID: <15e394b98302f5447431d51b697baf7c.axp-list@archive.invalid> (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

                 reply	other threads:[~1997-11-18 13:31 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