Re: Mathematics in Python are not correct

2008-05-12 Thread Arnaud Delobelle
Mark Dickinson <[EMAIL PROTECTED]> writes: > On May 12, 11:15 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > >> But exp(y*log(x)) -> 1 as (x, y) -> (0, 0) along any analytic curve >> which is not the x=0 axis (I think at least - it seems easy to prove >> that given f and g analytic over R, f(x)

Re: Mathematics in Python are not correct

2008-05-12 Thread Arnaud Delobelle
Lou Pecora <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >> "Mark Dickinson" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> On May 11, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> |> Do you have in mind any s

Re: Mathematics in Python are not correct

2008-05-12 Thread Mark Dickinson
On May 12, 11:15 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > But exp(y*log(x)) -> 1 as (x, y) -> (0, 0) along any analytic curve > which is not the x=0 axis (I think at least - it seems easy to prove > that given f and g analytic over R, f(x)*ln g(x) -> 0 as x -> 0 if > f(0)=g(0)=0 and g(x)>

Re: Mathematics in Python are not correct

2008-05-12 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mark Dickinson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > On May 11, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > |> Do you have in mind any situations in which it is advantageous to have >

Re: Mathematics in Python are not correct

2008-05-12 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I am stunned that this simple misunderstanding of mine ended in a > mathematical clash of a sort. :) You guys really blew me away wih > your mathematical knowledge. And also the 0**0 is a thing I've never > thought about trying, until n

Re: Mathematics in Python are not correct

2008-05-12 Thread Arnaud Delobelle
On 12 May, 15:21, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On May 12, 2:09 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > > Then it seems equally dubious that 0.**y, y>0, should be well-defined. > > It seems to me that lim as x goes to 0. exp(y*log(x)) is equally well > > defined whether y is

Re: Mathematics in Python are not correct

2008-05-12 Thread Mark Dickinson
On May 12, 2:09 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Then it seems equally dubious that 0.**y, y>0, should be well-defined. > It seems to me that lim as x goes to 0. exp(y*log(x)) is equally well > defined whether y is 0 or not, even though there is a discontinuity in the > limit. Well,

Re: Mathematics in Python are not correct

2008-05-11 Thread Terry Reedy
"Mark Dickinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 11, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: |> Do you have in mind any situations in which it is advantageous to have 0**0 |> undefined? | (Playing devil's advocate here.) If you regard x**y as exp(y*l

Re: Mathematics in Python are not correct

2008-05-11 Thread Mark Dickinson
On May 11, 9:36 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Do you have in mind any situations in which it is advantageous to have 0**0 > undefined? (Playing devil's advocate here.) If you regard x**y as exp(y*log(x)) then it's not at all clear that 0.**0. should be considered well-defined. And

Re: Mathematics in Python are not correct

2008-05-11 Thread Terry Reedy
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | [EMAIL PROTECTED] wrote: | > | >I am stunned that this simple misunderstanding of mine ended in a | >mathematical clash of a sort. :) You guys really blew me away wih | >your mathematical knowledge. And also the 0**0 is

Re: Mathematics in Python are not correct

2008-05-11 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >I am stunned that this simple misunderstanding of mine ended in a >mathematical clash of a sort. :) You guys really blew me away wih >your mathematical knowledge. And also the 0**0 is a thing I've never >thought about trying, until now that is. If the mathematical rule

Re: Mathematics in Python are not correct

2008-05-11 Thread Grant Edwards
On 2008-05-11, Max M <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] skrev: > >> I have two another interesting things to discuss about, for >> which I'll open new posts on this group. Look for "Python >> doesn't recognize quote types" and "Python, are you ill?". > > You have a tendency to form your

Re: Mathematics in Python are not correct

2008-05-11 Thread Max M
[EMAIL PROTECTED] skrev: I have two another interesting things to discuss about, for which I'll open new posts on this group. Look for "Python doesn't recognize quote types" and "Python, are you ill?". You have a tendency to form your questions as complaints about Python being broken. You w

Re: Mathematics in Python are not correct

2008-05-10 Thread Paddy
On May 10, 9:56 pm, [EMAIL PROTECTED] wrote: > I have two another interesting things to discuss about, for which I'll > open new posts on this group. Look for "Python doesn't recognize quote > types" and "Python, are you ill?". Hi, You might try making your titles a little more descriptive to hel

Re: Mathematics in Python are not correct

2008-05-10 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I am stunned that this simple misunderstanding of mine ended in a | mathematical clash of a sort. :) You guys really blew me away wih | your mathematical knowledge. And also the 0**0 is a thing I've never | thought about trying, until

Re: Mathematics in Python are not correct

2008-05-10 Thread wxPythoner
I am stunned that this simple misunderstanding of mine ended in a mathematical clash of a sort. :) You guys really blew me away wih your mathematical knowledge. And also the 0**0 is a thing I've never thought about trying, until now that is. If the mathematical rule is that EVERYTHING raised to th

Re: Mathematics in Python are not correct

2008-05-10 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Lou Pecora" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | In article <[EMAIL PROTECTED]>, > | "Terry Reedy" <[EMAIL PROTECTED]> wrote: > | > | > "Luis Zarrabeitia" <[EMAIL PROTECTED]> wrote in message

Re: Mathematics in Python are not correct

2008-05-09 Thread Terry Reedy
"Lou Pecora" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | In article <[EMAIL PROTECTED]>, | "Terry Reedy" <[EMAIL PROTECTED]> wrote: | | > "Luis Zarrabeitia" <[EMAIL PROTECTED]> wrote in message | > news:[EMAIL PROTECTED] | > | Btw, there seems to be a math problem in python with

Re: Mathematics in Python are not correct

2008-05-09 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Luis Zarrabeitia" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Btw, there seems to be a math problem in python with exponentiation... > | >>> 0**0 > | 1 > | That 0^0 should be a nan or exception, I g

Re: Mathematics in Python are not correct

2008-05-09 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Michael Torrie <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Have a look at this: > > > -123**0 > > -1 > > > > > > The result is not correct, because every number (positive or negative) > > raised to the power of 0 is ALWAYS 1 (a positive number

Re: Mathematics in Python are not correct

2008-05-08 Thread Arnaud Delobelle
Dan Bishop <[EMAIL PROTECTED]> writes: > On May 8, 6:14 pm, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: >> On Thursday 08 May 2008 06:54:42 pm [EMAIL PROTECTED] wrote: >> >> > The problem is that Python parses -123**0 as -(123**0), not as >> > (-123)**0. >> >> Actually, I've always written it as (

Re: Mathematics in Python are not correct

2008-05-08 Thread Luis Zarrabeitia
Quoting Ian Kelly <[EMAIL PROTECTED]>: > On Thu, May 8, 2008 at 10:15 PM, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > Weird, I can't find neither... (which wikipedia article? Couldn't find one > about > > C99.) > > Try http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_zero_power Than

Re: Mathematics in Python are not correct

2008-05-08 Thread Mensanator
On May 8, 11:28�pm, "Ian Kelly" <[EMAIL PROTECTED]> wrote: > On Thu, May 8, 2008 at 10:15 PM, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > �Weird, I can't find neither... (which wikipedia article? Couldn't find one > > about > > �C99.) > > Tryhttp://en.wikipedia.org/wiki/Exponentiation#Zero_to_

Re: Mathematics in Python are not correct

2008-05-08 Thread Ian Kelly
On Thu, May 8, 2008 at 10:15 PM, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > Weird, I can't find neither... (which wikipedia article? Couldn't find one > about > C99.) Try http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_zero_power -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematics in Python are not correct

2008-05-08 Thread Luis Zarrabeitia
Quoting Christian Heimes <[EMAIL PROTECTED]>: > Luis Zarrabeitia schrieb: > 0**0 > > 1 > > > > That 0^0 should be a nan or exception, I guess, but not 1. > > No, that's correct for floats. Read the wikipedia article or the C99 > standard for more information. Weird, I can't find neither..

Re: Mathematics in Python are not correct

2008-05-08 Thread Dan Bishop
On May 8, 6:14 pm, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > On Thursday 08 May 2008 06:54:42 pm [EMAIL PROTECTED] wrote: > > > The problem is that Python parses -123**0 as -(123**0), not as > > (-123)**0. > > Actually, I've always written it as (-123)**0. At least where I'm from, > exponentiat

Re: Mathematics in Python are not correct

2008-05-08 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Have a look at this: -123**0 -1 The result is not correct, because every number (positive or negative) raised to the power of 0 is ALWAYS 1 (a positive number 1 that is). The problem is that Python parses -123**0 as -(123**0), not as (-123)**0. I suggest making th

Re: Mathematics in Python are not correct

2008-05-08 Thread Terry Reedy
"Luis Zarrabeitia" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Btw, there seems to be a math problem in python with exponentiation... | >>> 0**0 | 1 | That 0^0 should be a nan or exception, I guess, but not 1. a**b is 1 multiplied by a, b times. 1 multiplied by 0 no times is 1

Re: Mathematics in Python are not correct

2008-05-08 Thread Christian Heimes
Luis Zarrabeitia schrieb: 0**0 > 1 > > That 0^0 should be a nan or exception, I guess, but not 1. No, that's correct for floats. Read the wikipedia article or the C99 standard for more information. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Mathematics in Python are not correct

2008-05-08 Thread castironpi
On May 8, 6:10 pm, Nicolas Dandrimont <[EMAIL PROTECTED]> wrote: > * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-05-08 15:54:42 -0700]: > > > Have a look at this: > > > >>> -123**0 > > -1 > > > The result is not correct, because every number (positive or negative) > > raised to the power of 0 is AL

Re: Mathematics in Python are not correct

2008-05-08 Thread Nicolas Dandrimont
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-05-08 15:54:42 -0700]: > Have a look at this: > > >>> -123**0 > -1 > > > The result is not correct, because every number (positive or negative) > raised to the power of 0 is ALWAYS 1 (a positive number 1 that is). > > The problem is that Python par

Re: Mathematics in Python are not correct

2008-05-08 Thread Ben Finney
[EMAIL PROTECTED] writes: > The problem is that Python parses -123**0 as -(123**0), not as > (-123)**0. As explicitly defined in the language reference, the "negative" operator has lower binding precedence than the "power" operator http://www.python.org/doc/ref/summary.html>. > I suggest making

Re: Mathematics in Python are not correct

2008-05-08 Thread Luis Zarrabeitia
On Thursday 08 May 2008 06:54:42 pm [EMAIL PROTECTED] wrote: > The problem is that Python parses -123**0 as -(123**0), not as > (-123)**0. Actually, I've always written it as (-123)**0. At least where I'm from, exponentiation takes precedence even over unary "-". (to get a power of -123, you mus

Re: Mathematics in Python are not correct

2008-05-08 Thread Michael Torrie
Ahem... That should have been: (negate (pow 123 0)) Using parenthesis to indicate precedence order of ops: -(123 ^ 0) The "-" you are using is not part of the number. It's a unary operator that negates something. In normal order of operations, it has a much lower priority than power. Your p

Re: Mathematics in Python are not correct

2008-05-08 Thread Michael Torrie
[EMAIL PROTECTED] wrote: > Have a look at this: > -123**0 > -1 > > > The result is not correct, because every number (positive or negative) > raised to the power of 0 is ALWAYS 1 (a positive number 1 that is). No python is correct. you're expression parses this way, when converted to a li

Mathematics in Python are not correct

2008-05-08 Thread wxPythoner
Have a look at this: >>> -123**0 -1 The result is not correct, because every number (positive or negative) raised to the power of 0 is ALWAYS 1 (a positive number 1 that is). The problem is that Python parses -123**0 as -(123**0), not as (-123)**0. I suggest making the Python parser omit the n