This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

G77 DOUBLE/SINGLE PRECISION PUZZLE


Dear Helpers

I am using Force2.0.7 which is an IDE for g77 running under MS windows.
What I was doing...
I tried an algorithm in a text for solving a partial 
differential equation numerically.
What happened..
running the program at work [we have Windows NT 4.0 installed] 
the answer came out right on the nose--the result column gave 
identical numbers to those in the text.
Thought I'd run same program at home [I have to do a lot of 
work at home too] and the result column came out really crook--
nothing like the correct solution. Went over the code and 
couldn't see anything wrong. Tried same program on one of my 
children's computers and got the same result.
Sitting there wondering what to do next when the thought 
occurred to me to try to see what happens for a small t 
increment [pde is in x and t--t from 0.0 to 0.5]. Tried a small 
step and solution looked OK. A little more and it started to 
drift--by time I went to 60 steps [t=0.3] it was getting way off.
So I thought hang it let's see what happens if I try double 
precision--and guess what--answer came in right on the nose like 
at work.
My home computer [and my children's] are running windows 98.
So does NT 4.0 give more precision for g77 than windows 98?

It's not a serious problem for me as I can work around it by 
using double precision at home but it is a little puzzling. 

Anyone got any thoughts on this??

kind regards
Stephen











------------------------------------------------
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]