How can I get a correct decimal results for a Python modulo operation (without extra libs)?

Question:

I am trying to get a correct decimal (not scientific) expression for the following equation. It seems, by default, Python prints the scientific notation. I am using Python on an embedded system, so I cannot easily install libs. I am looking for a default way to get the correct result.

>>> 4292739359**(-1) % 4292739360
2.329514830439068e-10

The correct expression is 4292739359. Python seems to show different results.

Asked By: wishi

||

Answers:

The Python equivalent is using pow:

>>> pow(4292739359, -1, 4292739360)
4292739359
Answered By: wim
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.