[issue15438] Incredible issue in math.pow

2012-07-26 Thread andrea bergamini

andrea bergamini  added the comment:

Ok guys, ticket closed, but I'm still confused: I'm not a Python expert, I've 
understood that math is a sort of wrapper of C math.h or something like this, 
but:
- I can't find any reason in using math.pow if I can get errors like the one 
explained.
- I've used math.h in my C++ code without having experienced any problem in 
that pow operation.
I'm surely missing something but I'm a bit confused...

--
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue15438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15438] Incredible issue in math.pow

2012-07-24 Thread andrea bergamini

andrea bergamini  added the comment:

Well, from a library I'm used to expect a good result or an exception. Not a 
value that differs from the correct of one unit! I agree with Antoine, the doc 
should warn about this behavior. I've lost a lot of time before discovering my 
application issue came from the py math library...

--

___
Python tracker 
<http://bugs.python.org/issue15438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15438] Incredible issue in math.pow

2012-07-24 Thread andrea bergamini

andrea bergamini  added the comment:

Ok, but math.pow IMPO has to be aligned to pow and built-in pow (**), otherwise 
this kind of "inaccuracies" can compromise the application behavior. I was 
using this funcion in a cryptographic mechanisms, and this issue resulted in a 
failure. 
Generally speaking, integer numbers should not be affected by inaccuracies. I 
mean, there's no floating point.

--

___
Python tracker 
<http://bugs.python.org/issue15438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15438] Incredible issue in math.pow

2012-07-24 Thread andrea bergamini

New submission from andrea bergamini :

math.pow(43, 10) gives the wrong result: 21611482313284248.0
Instead, the build-in function 43**10 and pow(43, 10) give the correct result: 
21611482313284249L.
This bug has been seen on ActivePython 2.5.1.1. Sorry no tests on recent 
versions.

--
components: Library (Lib)
messages: 166275
nosy: andrea.bergamini
priority: normal
severity: normal
status: open
title: Incredible issue in math.pow
type: behavior

___
Python tracker 
<http://bugs.python.org/issue15438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com