I would like to know how would one represent infinity if there is no built-in function for you to do so.
I know that if we are using float
or double
, we will be able to use infinity()
with #include <limits>
. But if I need to use int
or in the case of NTL, ZZ
, how should I represent infinity? Should I write something new? How is it represented in C++?
Edit: I'm posing this question because I would like to implement an addition algorithm for point on an elliptic curve. So, I'll need infinity to represent the point of infinity. I was wondering if I'll be better off using projective coordinates and have [0:1:0] to represent the point at infinity, but wanted to explore the infinity in int
or ZZ
option first.