Re: make check errors on linux

On Thu, 11 Jan 2001, Dick Porter wrote:
> > +		fprintf (stderr, "%g == %g ?\n", 
> > +			 DynamicAny_DynAny_get_double (dyn_any, ev), d);
> >  		g_assert (DynamicAny_DynAny_get_double (dyn_any, ev) ==
> > d);
> > 
> > 	Of course; it's probably my dumb mistake somewhere.
> Comparing floats with == is a dumb mistake :-)

	Well; you seem to be right, however no manipulaton is done on the
floats, they are simply copied from a to b and then compared. ie if:

	double a = 3.5, b;
	b = a;
	g_assert (a == b);

	fails; then something strange is happening. Worse still when the
chap adds the fprintf then the compare succeeds.

	Hey ho,


 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot

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