Bug in math Library
Respected Sir/Ma'am; I am Parth Desai, CSE engineer , from Nirma university. This mail was written to draw your attention to a very obvious bug in the math library in python. There are 7 indefinite form in Calculus. For eg. 0^inf , inf^inf, inf ^ 0 etc, The answer according to conventional mathematics should be "indefinite" or "Nan"(according to python). However, Python calculates these indefinite forms and returns false answers which would technically be very harmful for data analysts worldwide. Attached with this mail are screenshots of a few of them. This mistake was found with the help of my friend Chirag Patadiya, CSE engineer, from Nirma university. Please take this into consideration and respond accordingly. Thank you. P.S. infinity^(-infinity) should also be undefined.
Hi Prath,
This mail was written to draw your attention to a very obvious bug in the math library in python. There are 7 indefinite form in Calculus. For eg. 0^inf , inf^inf, inf ^ 0 etc, The answer according to conventional mathematics should be "indefinite" or "Nan"(according to python). However, Python calculates these indefinite forms and returns false answers
Thanks for noticing! This has already been discussed here: https://bugs.python.org/issue1681671, feel free to read the thread and comment as needed. Also according to Wikipedia 0 ** ∞ is not indefinite: https://en.wikipedia.org/wiki/Indeterminate_form#Expressions_that_are_not_in.... Also IIRC 1 ** ∞ is considered indeterminate "if we vary 1" (by defining 1 ** ∞ as lim[x→1, y→∞] x^y). I may be a bit too practical here, but 1 does *not* vary in Python, so it's (*in practice*) lim[x→∞] 1^x which *is* 1. Anyway let's continue this discussion on bugs.python.org if needed. Bests, -- Julien Palard https://mdk.fr
Thank you, I'll check them out. This was very helpful.
On Thu, 9 Jan 2020, 9:28 pm Julien Palard,
Hi Prath,
This mail was written to draw your attention to a very obvious bug in the math library in python. There are 7 indefinite form in Calculus. For eg. 0^inf , inf^inf, inf ^ 0 etc, The answer according to conventional mathematics should be "indefinite" or "Nan"(according to python). However, Python calculates these indefinite forms and returns false answers
Thanks for noticing!
This has already been discussed here: https://bugs.python.org/issue1681671, feel free to read the thread and comment as needed.
Also according to Wikipedia 0 ** ∞ is not indefinite: https://en.wikipedia.org/wiki/Indeterminate_form#Expressions_that_are_not_in... .
Also IIRC 1 ** ∞ is considered indeterminate "if we vary 1" (by defining 1 ** ∞ as lim[x→1, y→∞] x^y). I may be a bit too practical here, but 1 does *not* vary in Python, so it's (*in practice*) lim[x→∞] 1^x which *is* 1.
Anyway let's continue this discussion on bugs.python.org if needed.
Bests, -- Julien Palard https://mdk.fr
участники (2)
-
Julien Palard
-
PARTH DESAI