Representation of infinity in c. In c, infinity is represented by inf or inf. Typically, it results from a division by zero or null value.

Understanding the Context

All the servers run in an infinite loop as the server responds to all the client requests. It comes out of an indefinite loop only when the administrator shuts down the server manually. Tackling this rather long. The basic operations and math functions all accept infinity and nan and produce sensible output.

Key Insights

Infinities propagate through calculations as one would expect: For example, 2 + ∞ = ∞ , 4/∞ =. Inf is a special floating point value, arising, for example, from division over zero. The latter indeed happens in your program: When n reaches zero, your loop still continues and. The output is infinte when i want to get the triangle area. I want to get the triangle area only when the sum of two sides is bigger than the other side.

Final Thoughts

All these nan, ind, inf and den are a graceful way of telling the user that something has gone out of the boundary. It provides the floating point unit (fpu), otherwise. Infinity is a macro constant defined in the library, and programmers use it to perform mathematical comparisons in c. #include example. C allows us to define infinity. Next, locate the filename printed next to it.

The macro returns an integral value. Even if the argument is. There is in c99, but not in previous standards afaik. In c99, you'll have nan and infinity macros.