I wrote a program for finding the two large prime nos which are used in a RSA key. It is just a ctf challenge. The problem which I am facing is that the number is being shown in power of 10 which I don't want. I want the result to be in complete number form (not in power of 10 but can be in decimal).
I already tried the Decimal library of python but I don't know why it is resulting in a wrong answer. When removed the Decimal library and it's functions it is showing the right result. However, even during the result the Decimal library is not proving the answer in complete number.
The code:
import math
n = 456378902858290907415273676326459758501863587455889046415299414290812776158851091008643992243505529957417209835882169153356466939122622249355759661863573516345589069208441886191855002128064647429111920432377907516007825359999
s=str(math.sqrt(n))
print (s)
s=math.ceil(s)
print(s)
k=(s*s)-n
print(k)
k=math.ceil(k)
j=math.sqrt(k)
print(j)
p= (s-j)
q= (s+j)
print("p = " , p)
print("q = " , q)
i = p*q
l = n-i
print(l)
In this the result is 0 of l. But the p and q which I require are in huge numbers and are ( 2.136302629426752e+112 ) in power of 10 form.