Today I found a very interesting fact. int gcc, If you write cout << 5/0 << endl; it will cause a division by zero exception and get RTE. if you write cout << 5.0/0.0 << endl; it will output nan!!!!!!!! cout << atan(5/0) causes RTE while atan(5.0/0.0) causes correct output!
Division by zero is undefined behavior so, after all, it isn't that surprising when strange things happen :)
http://stackoverflow.com/questions/3004095/division-by-zero-undefined-behavior-or-implementation-defined-in-c-and-or-c
Unlike integer division, floating point division by zero is well-defined.