I’ve encountered what might be a problem. I calculate all the values p, q, Phi, N, e, d, and when I go to check if e*d=1mod(p-1)(q-1) instead of getting 1 I get .999999327… or another extremely long decimal that’s close to 1. Is this due to an incorrect step or maybe because I do not use 512 bit long numbers, but rather short ones? Also I used d=(1/e)mod(phi).