[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#143526: wmspaceweather 1.04-7: floating point error (forward)



Hello,

Thanks to Jurriaan and Ineiti! Now I would be very glad if someone could
fetch the wmspaceweather sources, apply the patch attached to this email,
recompile and tell me, whether this fixes the bug on Alpha...

Please CC me when replying.

Thanks a lot! -- Martin
diff -ur wmspaceweather-1.04.old/wmSpaceWeather/wmSpaceWeather.c wmspaceweather-1.04/wmSpaceWeather/wmSpaceWeather.c
--- wmspaceweather-1.04.old/wmSpaceWeather/wmSpaceWeather.c	Fri Apr 19 14:20:37 2002
+++ wmspaceweather-1.04/wmSpaceWeather/wmSpaceWeather.c	Fri Apr 19 14:32:31 2002
@@ -117,13 +117,13 @@
 int			Hours, Mins, Secs, OldSecs, xoff, D[10], xsize;
 long		CurrentLocalTime;
 int			height, UpToDate, LEDOn;
-double		UT, TU, TU2, TU3, T0, gmst, hour24();
+double		UT = 0.0;
 
 
-double		jd(), CurrentJD, LatestAvailJD, tim, DeltaT;
+double		jd(), CurrentJD = 0.0, LatestAvailJD = 0.0, tim = 0.0, DeltaT = 0.0;
 long int		TimeTag[8];
 int 		Kp[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
-double		E1, E2, P1, P2, P3;
+double		E1 = 0.0, E2 = 0.0, P1 = 0.0, P2 = 0.0, P3 = 0.0;
 char		FileName[256], Xray[10], digit[2];
 FILE		*fp;
 
@@ -590,11 +590,9 @@
  *  Compute the Julian Day number for the given date.
  *  Julian Date is the number of days since noon of Jan 1 4713 B.C.
  */
-double jd(ny, nm, nd, UT)
-int ny, nm, nd;
-double UT;
+double jd(int ny, int nm, int nd, double UT)
 {
-        double A, B, C, D, JD, MJD, day;
+        double A = 0.0, B = 0.0, C = 0.0, D = 0.0, JD = 0.0, MJD = 0.0, day = 0.0;
 
         day = nd + UT/24.0;
 

Reply to: