you should know that division by zero is allowed with float, so:
1.0/0.0
equal to infinity, and this:
1.0/-0.0
equal to negative infinity (-0.0 negative zero, like 1 / 0- in mathematics), and this:
0.0/0.0
- this is NAN, which means not a number, it is not exactly defined in the abbreviation of mathematics. that with float, but ints will throw a runtime error, you may ask why, due to the way floats are represented in binary form, you can read about it here:
http://floating-point-gui.de/formats/fp/
in C # you can say Double.PositiveInfinity, Double.NegativeInfinity and Double.NaN
source share