Decimals and other numbers

Dave Angel davea at davea.name
Fri Jan 9 08:49:27 CET 2015


On 01/09/2015 02:37 AM, Chris Angelico wrote:
> On Fri, Jan 9, 2015 at 6:28 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> Devin Jeanpierre <jeanpierreda at gmail.com>:
>>
>>> 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,
>>
>>      lim    y(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)
>>     >>> y
>>     0.0030102999566398118
>>     >>> x**y
>>     0.5
>
> I'm not a mathematical expert, so I don't quite 'get' this. How does
> this justify 0**0 being equal to 0.5?
>
> I know how to justify 0 and 1, and NaN (on the basis that both 0 and 1
> can be justified). I don't follow how other values can be used.

Roughly speaking, the idea is to have a relationship between x and y, 
such that even though they each get arbitrarily close to zero, the 
formula x**y is a constant 5.

So he plugged in 1e-100.  But if you plugged in 1e-500000000  and could 
handle the precision, the result x**y  would still be 0.5




-- 
DaveA



More information about the Python-list mailing list