Siedem śmiertelnych grzechów matematyki

I tylko można zastanowić się jak to będzie w C?

#include <stdio.h>
#include <math.h>

int main(int argc, char **argv)
{
	double a = 0.;
	double b = 0.;
	double c = INFINITY;
	double d = 1.;
	printf("%f / %f = %f\n", a, b, a/b);
	printf("%f / %f = %f\n", c, c, c/c);
	printf("%f * %f = %f\n", a, c, a * c);
	printf("pow(%f, %f) = %f\n", a, b, pow(a, b));
	printf("pow(%f, %f) = %f\n", c, a, pow(c, a));
	printf("pow(%f, %f) = %f\n", d, c, pow(d, c));	
	printf("%f - %f = %f\n", c, c, c - c);
	return 0;
}

Mi wyszło jakoś tak

0.000000 / 0.000000 = -nan
inf / inf = -nan
0.000000 * inf = -nan
pow(0.000000, 0.000000) = 1.000000
pow(inf, 0.000000) = 1.000000
pow(1.000000, inf) = 1.000000
inf - inf = -nan
Wojciech Myszka
Wojciech Myszka
dr inż. adiunkt

Tak się tylko rozglądam…