On Fri, 09 Jan 2015 19:57:20 -0800, Devin Jeanpierre wrote:
> On Fri, Jan 9, 2015 at 7:05 PM, Gregory Ewing
> wrote:
>> It's far from clear what *anything* multiplied by itself zero times
>> should be.
>>
>> A better way of thinking about what x**n for integer n means is this:
>> Start with 1, an
On Fri, Jan 9, 2015 at 7:05 PM, Gregory Ewing
wrote:
> It's far from clear what *anything* multiplied by
> itself zero times should be.
>
> A better way of thinking about what x**n for integer
> n means is this: Start with 1, and multiply it by
> x n times. The result of this is clearly 1 when n
>
Steven D'Aprano wrote:
I'm just sketching an informal proof. If you want to make it vigorous
I think the usual term is "rigorous", unless the mathematician
is taking some kind of stimulant... :-)
--
Greg
--
https://mail.py
Steven D'Aprano wrote:
Arguably, *integer* 0**0 could be zero, on the basis that you can't take
limits of integer-valued quantities, and zero times itself zero times
surely has to be zero.
It's far from clear what *anything* multiplied by
itself zero times should be.
A better way of thinking a
On Fri, Jan 9, 2015 at 2:20 AM, Steven D'Aprano
wrote:
-snip-
> I don't understand what you're trying to say here. You can't just
> arbitrarily declare that 0**1 equals something other than 0 (or for that
> matter, doesn't equal anything at all).
You can, actually. It's just silly. (Similarly, yo
On Fri, Jan 9, 2015 at 11:24 PM, Steven D'Aprano
wrote:
>> 5 * 0 * 0 * 0 * 0 = 0
>
> Where did the 5 come from?
>
> You're effectively saying that 0**0 becomes 5*0**0, then cancelling the 0**0
> because they're all zeroes and so don't matter, leaving 5. And that simply
> doesn't work. If it did wo
I want to emphasis that I'm not really arguing that 0**0 should evaluate as
0. That's probably the least useful thing we can have out of the four
possibilities:
- return 1
- return NAN
- raise an exception
- return 0
But in the spirit of the Devil's Advocate, I mentioned that there was an
argumen
Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> mathematicians with a pragmatic bent
>
> You shouldn't call engineers and scientists mathematicians ("with a
> pragmatic bent"). Rigor is an absolute requirement for any mathematics.
I wasn't referring to engineers, scientists, short-order cooks or
On Fri, Jan 9, 2015 at 9:20 PM, Steven D'Aprano
wrote:
> On the basis that m**n means m multiplied by itself n times:
>
> 5**4 = 5*5*5*5 = 625
>
> that gives us:
>
> 0**0 = zero multiplied by itself zero times.
>
> You can multiply 0 by any number you like, and the answer will always be 0,
> not 1
I think we're in violent agreement here, nevertheless I think you're right
for the wrong reasons. See below...
Devin Jeanpierre wrote:
> On Fri, Jan 9, 2015 at 12:49 AM, Steven D'Aprano
> wrote:
>> Devin Jeanpierre wrote:
>>
>>> On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel wrote:
What you d
Steven D'Aprano :
> Devin Jeanpierre wrote:
> No you can't -- that would make arithmetic inconsistent. 0**1 is
> perfectly well defined as 0 however you look at it:
You *could* leave 0**1 undefined. You *could* leave 7+0 undefined.
However, that would make mathematical proofs more complex as they
Steven D'Aprano :
> mathematicians with a pragmatic bent
You shouldn't call engineers and scientists mathematicians ("with a
pragmatic bent"). Rigor is an absolute requirement for any mathematics.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico :
> I'm not a mathematical expert, so I don't quite 'get' this. How does
> this justify 0**0 being equal to 0.5?
Many operations like this are defined in terms of some very strong
argument of uniqueness. Ultimately, the key point is safety in
mathematical deductions. One minimal re
On Fri, Jan 9, 2015 at 12:58 AM, Devin Jeanpierre
wrote:
>> Arguably, *integer* 0**0 could be zero, on the basis that you can't take
>> limits of integer-valued quantities, and zero times itself zero times
>> surely has to be zero.
I should have responded in more detail here, sorry.
If you aren'
Devin Jeanpierre writes:
[...]
> domain of the natural numbers. Knuth says that thought of
> combinatorially on the naturals, x**y counts the number of mappings
> from a set of x values to a set of y values.
It's the other way around, of course: from a set of y values to a set
of x values.
Whi
On Fri, Jan 9, 2015 at 12:49 AM, Steven D'Aprano
wrote:
> Devin Jeanpierre wrote:
>
>> On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel wrote:
>>> What you don't say is which behavior you actually expected. Since 0**0
>>> is undefined mathematically, I'd expect either an exception or a NAN
>>> result.
Marko, your argument is "this function x**y(a, x) must be continuous
on [0, inf), and to be continuous at 0, 0**0 must be a". Since there
are many possible values of a, this is not a "justification", this is
a proof by contradiction that the premise was faulty: x**y(a, x)
doesn't have to be continu
Devin Jeanpierre wrote:
> On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel wrote:
>> What you don't say is which behavior you actually expected. Since 0**0
>> is undefined mathematically, I'd expect either an exception or a NAN
>> result.
>
> It can be undefined, if you choose for it to be. You can a
On 01/09/2015 02:37 AM, Chris Angelico wrote:
On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa wrote:
Devin Jeanpierre :
If 0**0 is defined, it must be 1.
You can "justify" any value a within [0, 1]. For example, choose
y(a, x) = log(a, x)
Then,
limy(a, x) = 0
x -> 0+
and
On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa wrote:
> Devin Jeanpierre :
>
>> If 0**0 is defined, it must be 1.
>
> You can "justify" any value a within [0, 1]. For example, choose
>
>y(a, x) = log(a, x)
>
> Then,
>
> limy(a, x) = 0
>x -> 0+
>
> and:
>
>lim[x -> 0+] x**y(a, x
Devin Jeanpierre :
> If 0**0 is defined, it must be 1.
You can "justify" any value a within [0, 1]. For example, choose
y(a, x) = log(a, x)
Then,
limy(a, x) = 0
x -> 0+
and:
lim[x -> 0+] x**y(a, x) = a
For example,
>>> a = 0.5
>>> x = 1e-100
>>> y = math.log(a, x)
Dave Angel :
> What you don't say is which behavior you actually expected. Since 0**0
> is undefined mathematically, I'd expect either an exception or a NAN
> result.
IEEE 754 mandates that 0**0 should evaluate to 1:
http://en.wikipedia.org/wiki/NaN#Operations_generating_NaN>
The standar
Thanks Ben, with your encouragement I have filed
http://bugs.python.org/issue23201
-- Devin
On Thu, Jan 8, 2015 at 7:03 PM, Ben Finney wrote:
> Dave Angel writes:
>
>> What you don't say is which behavior you actually expected. Since
>> 0**0 is undefined mathematically, I'd expect either an ex
Dave Angel writes:
> What you don't say is which behavior you actually expected. Since
> 0**0 is undefined mathematically, I'd expect either an exception or a
> NAN result.
Do you think that the ‘int’ and ‘float’ types, which do produce a number
result for ‘0 ** 0’, are buggy and should be fixe
On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel wrote:
> What you don't say is which behavior you actually expected. Since 0**0 is
> undefined mathematically, I'd expect either an exception or a NAN result.
It can be undefined, if you choose for it to be. You can also choose
to not define 0**1, of co
On Thu, Jan 8, 2015 at 6:33 PM, Devin Jeanpierre wrote:
> I noticed some very PHP-ish behavior today:
>
import decimal
x = 0
y = float(x)
z = decimal.Decimal(x)
x == y == z == x
> True
x ** x
> 1
y**y
> 1.0
z**z
> Traceback (most recent call last):
> File
On 01/08/2015 09:33 PM, Devin Jeanpierre wrote:
I noticed some very PHP-ish behavior today:
import decimal
x = 0
y = float(x)
z = decimal.Decimal(x)
x == y == z == x
True
x ** x
1
y**y
1.0
z**z
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/decimal
Devin Jeanpierre writes:
> decimal.InvalidOperation: 0 ** 0
>
> I'd file a bug report but I'm anticipating some rational (heh)
> explanation. Any ideas?
First note that it's explicitly documented as an invalid operation
.
So someone has at least thought about it and deliberately decided it
shoul
28 matches
Mail list logo