a = math.log(123456789123456789)
b = exp(a)
print(int(round(abs(b))))
output:
123456789123457168
There is data loss after doing anitlog please tell me how to avoid it
a = math.log(123456789123456789)
b = exp(a)
print(int(round(abs(b))))
output:
123456789123457168
There is data loss after doing anitlog please tell me how to avoid it
You can use Decimal
from decimal
module to handle large numbers:
from decimal import Decimal
a = Decimal(123456789123456789).ln()
b = a.exp()
print(int(round(abs(b))))
Output:
123456789123456789