tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Ernie Bisson, MIT Bates Linear Accelerator" <BISSON () AESIR ! MIT ! EDU>
To: tru64-unix-managers
Subject: cc floating point problems
Date: Tue, 26 Sep 1995 20:20:45 +0000	[thread overview]
Message-ID: <96075323306727.tru64-unix-managers.marc@archive.invalid> (raw)


I'm having a bizarre problem with floating-point operations in C on an
AlphaServer 1000 4/200 running Digital-Unix V3.2A.

Here is a simple C program to demonstrate:

#include <stdio.h>

main()

{
float  fff = 4.333;
float  ggg = 1/65535;
  
printf("ggg = %f\n",ggg);
printf("1/65535 = %f\n",1/65535);
printf("fff = %f\n",fff);
printf("1/65535 = %f\n",1/65535);
printf("ggg = %f\n",ggg);

}


The results produced after building it using the compiler /usr/bin/cc:

ggg = 0.000000
1/65535 = 0.000000
fff = 4.333000
1/65535 = 4.333000
ggg = 0.000000

I get the same results from V3.0 and V3.2 systems.
I get Correct results on Ultrix V4.3A and SunOS 4.1.3_U1 systems.
Translating from the mips binary to AXP, via "mx", also works correctly.
Does anyone know of any problems that could be causing this?


Thanks for any help,

Ernie Bisson
M.I.T. Bates Linear Accelerator
P.O. Box 846
Middleton, Massachusetts  01949-2846
(617) 774-2370

E-Mail: bisson@bates.mit.edu

                 reply	other threads:[~1995-09-26 20:20 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