-1.#IND00

Debugging a recent issue, where our _matherr handler was logging a call to sqrt with -1.#IND00 as input, and in this same scenario the system was crashing (the actual problem needing to be solved).

So to findout what input was going into the sqrt, as I suspected there was rubish being passed in, I wanted to know what -1.#IND00 was in binnary.

I knew that passing -1.0 to sqrt would result in -1.#IND00 in the result, so I altered the code:

int main ()
{
	double d = sqrt(-1.0);
}

int __cdecl _matherr(struct _exception *e)
{
	informf( "\nMath Error: %s, Parameters: %lf %lf, Return: %lf\n",
		e->name, e->arg1, e->arg2, e->retval ) ;

	union ccc
	{
		double d;
		struct {
			long a;
			long b;
		} ll;
	};

	ccc aa;

	aa.d = e->retval;

<break point here, and inspect aa in debugger>
	if( _isnan( e->retval ) ) {
		e->retval = 0 ;
	}
	return 1 ;
}

results in the values:

aa.ll.a = 0;
aa.ll.b = 0xFFF80000;

And I posted this because Googling for -1.#IND00 got me no results.

Back from Colorado Road Trip

We’re back from a family trip to Colorado. We drove there and back, because I’m cheap, and I’d always wanted to do a ‘road trip’.

It was a really good experience, getting to see parts of the USA not seen before, and experiencing the change in landscape.

So I have posted the above picture as my new header to remember the trip by.

Will post some pictures once I’ve processed them…