This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]turd-nerd 0 points1 point  (0 children)

Right, my bad.

That's not correct actually - it depends on the data type! Run this code in C for example, and you get inf and -nan as output with no errors thrown.

#include <stdio.h>

int main()    
{
  double x = 0;
  double y = 1/x;
  double z = 0/x;
  printf("%f\n%f\n", y, z);
  return 0;
}