How variable beyond "unsigned long long" size is represented in C or any programming language. Is there are variable type to represent Infinity?
Both floats and doubles have representations for infinity. Integral types do not have this capacity built into the language but, if you need it, there are tricks you can use to assign INT_MAX or LONG_MAX from limits.h for that purpose.
Of course, to do that, you have to have complete control of the calculations - you don't want a regular calculation ending up with that value and then being treated as infinity from there on.
For numbers larger than those that can be represented by the native types, you can turn to an arbitrary precision math library such as GMP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With