In one of the first FHE schemes by Gentry, the KeyGen algorithm is defined as follow:
For a security parameter $\lambda$, set $N = \lambda ^ 2, P = \lambda ^ 2, Q = \lambda ^ 5$.
KeyGen$(\lambda)$: Generate a random $P$-bit odd integer, $p$. A set $\vec{y} = \{ y_1, y_2, \ldots, y_\beta\}$ is generated with $y_i$ bits. There must exist a sparse subset $S \subset \vec{y}$ of $\alpha$ elements such that $\sum\limits_{y_j \in S} (y_j) = \frac{1}{p} \mod 2$.
Set $sk$ to be a binary encoding of the subset $S$, where $s = (0,1)^\beta$. Set $pk \leftarrow (p, \vec{y})$.
My problem here is with the subset S. Especially, for a large enough security parameter, the random integer $p$ is so large that I don't see how to print its inverse on my terminal. Are there some specific libraries in Python or C to handle this kind of inverse? I have tried to shift it by the size of p in base 10 but the problem remains as I can't convert p to float/double before dividing.
This may not be the most accurate forum for this question, and I apologize in advance if it is not.