i just start to learn and doing programming with python (was an old timer programmer in other languages). when i saw a project idea about creating your own squareroot function, i tried it.
the problem start was when i try to compare the result of
where x is not an integer. one example that i tried is:
2.2**2 resulting 4.840000000000001
which we all know that is incorrect. i also tried using the math.pow function, but the result is the same.
can anyone help me to solve this problem? thanks.
P.S. I also tried it on python 2.6.2 which results is even more strange (4.8400000000000007)