Article View: comp.sys.transputer
Article #1615Improper results on T800
From: Zafar Ullah Choudhry
Date: Thu, 25 Apr 1991 06:00
Date: Thu, 25 Apr 1991 06:00
57 lines
2517 bytes
2517 bytes
/* Hi Xputer Users! I have a small program which I am trying to run on
T800 processor. If this program is compiled for T400 processor, i.e.,
math functions are emulated, you get the proper results. However, if
you compile it for T800, the results become zero. In both the cases
the program is executed on T800. I have tried Logical C and 3L
compilers, both give the same results. The problem is actually with
improper rounding off. I know one way of fixing the problem but I want
to get the opinion from other users. Also, this problem shows up in the
form of inaccurate results in some other types of data. Please inform
me about your if you get a chance to try this tiny program on your
system.
THE PROGRAM PRINTS BOTH THE REQUIRED AND CALCULATED RESULTS.
Thanks.
Zafar Ullah Choudhry
Email: choudhry@bagend.eng.umd.edu
University of Maryland, College
Park, USA.
*/
/* ***** Header include files. ***** */
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
main ()
{
int nsite;
float we, weneg, freea[10], free_l[20], yin[12], xdin[10];
float xin[10], xdpn[10], freadp[10], clongp[10], ydin[10];
/* initialize the constants and variables */
we = 7.29211508E-5; /* Earth sidereal rotation rate. */
weneg = -7.29211508E-5; /* Negative rotation rate. */
nsite = 0;
freea[8] = 0.250648; yin[nsite] = -16018765.0000;
freea[7] = -0.968078; xdin[nsite]=1168.106812;
/* caculate the result */
free_l[1] = freea[8] * (we * yin[nsite] + xdin[nsite]);
free_l[2] = freea[7] * (we * yin[nsite] + xdin[nsite]);
printf ("The Expected Results:> free_l[1]=%f and free_l[2]=%f\n",
-0.000002, 0.000007);
printf ("The Calculated Values:> free_l[1]=%f and free_l[2]=%f\n",
free_l[1], free_l[2]);
printf ("Done...\n");
exit (0);
}
Technical Details
Message-ID:
<1991Apr25.060030.27603@eng.umd.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!mimsy!mojo!choudhryShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!mimsy!mojo!choudhry From: choudhry@eng.umd.edu (Zafar Ullah Choudhry) Newsgroups: comp.sys.transputer Subject: Improper results on T800 Message-ID: <1991Apr25.060030.27603@eng.umd.edu> Date: 25 Apr 91 06:00:30 GMT Sender: news@eng.umd.edu (C-News) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 57