In article ,
Steven D'Aprano wrote:
>
>[st...@sylar ~]$ cat ws-example.rb
Ahhh, you're a Heroes fan. ;-)
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
"Many customs in this life persist because they ease friction and promote
productivity as a result of unive
On Tue, 23 Feb 2010 05:48:09 -0800, Mark Dickinson wrote:
> On Feb 23, 8:11 am, Steven D'Aprano
> wrote:
>> Making spaces significant in that fashion is mind-bogglingly awful.
>> Let's look at a language that does this:
>>
>> [st...@sylar ~]$ cat ws-example.rb
>> def a(x=4)
>> x+2
>> end
>>
>
On Feb 23, 8:11 am, Steven D'Aprano
wrote:
> Making spaces significant in that fashion is mind-bogglingly awful. Let's
> look at a language that does this:
>
> [st...@sylar ~]$ cat ws-example.rb
> def a(x=4)
> x+2
> end
>
> b = 1
> print (a + b), (a+b), (a+ b), (a +b), "\n"
>
> [st...@sylar ~]
On Mon, 22 Feb 2010 18:01:44 +, Albert van der Horst wrote:
> In article ,
> Terrence Cole wrote:
>>Can someone explain to me what python is doing here?
>>
>>Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) [GCC 4.3.4] on linux2
>>Type "help", "copyright", "credits" or "license" for more inf
In article ,
Terrence Cole wrote:
>Can someone explain to me what python is doing here?
>
>Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
>[GCC 4.3.4] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
-0.1 ** 0.1
Python 4.0
Warning: misleading blank space,
Terry Reedy writes:
> On 2/12/2010 4:40 AM, Jussi Piitulainen wrote:
> > Terry Reedy writes:
> >> On 2/11/2010 11:23 AM, Jussi Piitulainen wrote:
> >>> Robert Kern writes:
> On 2010-02-11 06:31 AM, Shashwat Anand wrote:
> > There is a little issue here that '>>> -.1 ** .1' should give yo
On 2/12/2010 4:40 AM, Jussi Piitulainen wrote:
Terry Reedy writes:
On 2/11/2010 11:23 AM, Jussi Piitulainen wrote:
Robert Kern writes:
On 2010-02-11 06:31 AM, Shashwat Anand wrote:
There is a little issue here that '>>> -.1 ** .1' should give you
error message. That is it.
No, fractional
Terry Reedy writes:
> On 2/11/2010 11:23 AM, Jussi Piitulainen wrote:
> > Robert Kern writes:
> >> On 2010-02-11 06:31 AM, Shashwat Anand wrote:
> >>> There is a little issue here that '>>> -.1 ** .1' should give you
> >>> error message. That is it.
> >>
> >> No, fractional powers of negative numb
On 2010-02-11, Terrence Cole wrote:
> Can someone explain to me what python is doing here?
>
> Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
> [GCC 4.3.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
-0.1 ** 0.1
> -0.7943282347242815
a = -0.1; b
In article ,
Grant Edwards wrote:
>
>Didn't we just do this one last week?
Let's do the Time Warp again!
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
"At Resolver we've found it useful to short-circuit any doubt and just
refer to comments in code as
On 2/11/2010 11:23 AM, Jussi Piitulainen wrote:
Robert Kern writes:
On 2010-02-11 06:31 AM, Shashwat Anand wrote:
There is a little issue here that '>>> -.1 ** .1' should give you
error message. That is it.
No, fractional powers of negative numbers are perfectly valid
mathematically. The res
Robert Kern writes:
> On 2010-02-11 06:31 AM, Shashwat Anand wrote:
> > There is a little issue here that '>>> -.1 ** .1' should give you
> > error message. That is it.
>
> No, fractional powers of negative numbers are perfectly valid
> mathematically. The result is a complex number. In Python 3 (
On 2010-02-11 06:31 AM, Shashwat Anand wrote:
Do you really believe that -0.1 ** 0.1 is a valid computational problem
? Can you raise a negative number to a fractional power ?
Output on my console (python 2.6)
>>> -.1 ** .1
-0.79432823472428149
>>> a,b = -.1,.1
>>> a**b
Traceback (most recent
On Feb 11, 1:38 pm, Duncan Booth wrote:
> Tim Chase wrote:
> > But perhaps Py3 changes evaluation, returning an complex number.
>
> Yes, the change is documented
> athttp://docs.python.org/3.1/reference/expressions.html#the-power-operator
>
> If it is in any of the "What's new in Python x.xx" do
Tim Chase wrote:
> But perhaps Py3 changes evaluation, returning an complex number.
Yes, the change is documented at
http://docs.python.org/3.1/reference/expressions.html#the-power-operator
If it is in any of the "What's new in Python x.xx" documents or in a PEP
somewhere I haven't spotted it
On 2/11/10, Terrence Cole wrote:
> Can someone explain to me what python is doing here?
>
> Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
> [GCC 4.3.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
-0.1 ** 0.1
> -0.7943282347242815
a = -0.1; b = 0.
Terrence Cole wrote:
Can someone explain to me what python is doing here?
Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
-0.1 ** 0.1
-0.7943282347242815
a = -0.1; b = 0.1
a ** b
(0.75545104371175
Terrence Cole writes:
> Can someone explain to me what python is doing here?
>
> Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
> [GCC 4.3.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> -0.1 ** 0.1
> -0.7943282347242815
> >>> a = -0.1; b = 0.1
> >>>
Just realized my flaw
>>> .1**.1
0.79432823472428149
>>> (-.1)**(.1)
Traceback (most recent call last):
File "", line 1, in
ValueError: negative number cannot be raised to a fractional power
- a ** b = - (a ** b) and not (-a) ** b, Thats why -.1**.1 giving you
-0.79432823472428149 since .1 **
Terrence Cole wrote:
-0.1 ** 0.1
> -0.7943282347242815
a = -0.1; b = 0.1
a ** b
> (0.7554510437117542+0.2454609236416552j)
-abs(a ** b)
> -0.7943282347242815
>
> Why does the literal version return the signed magnitude and the
> variable version return a complex?
The binary po
Do you really believe that -0.1 ** 0.1 is a valid computational problem ?
Can you raise a negative number to a fractional power ?
Output on my console (python 2.6)
>>> -.1 ** .1
-0.79432823472428149
>>> a,b = -.1,.1
>>> a**b
Traceback (most recent call last):
File "", line 1, in
ValueError: neg
Terrence Cole wrote:
> Can someone explain to me what python is doing here?
>
> Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
> [GCC 4.3.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
-0.1 ** 0.1
> -0.7943282347242815
a = -0.1; b = 0.1
a **
On Feb 11, 12:44 am, Terrence Cole wrote:
> Can someone explain to me what python is doing here?
> >>> -0.1 ** 0.1
> -0.7943282347242815
Here you're computing -(0.1 ** 0.1). The exponentiation operator
binds more strongly than the negation operator.
> >>> a = -0.1; b = 0.1
> >>> a ** b
> (0.75
On Thu, Feb 11, 2010 at 1:44 AM, Terrence Cole
wrote:
> Can someone explain to me what python is doing here?
>
> Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
> [GCC 4.3.4] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
-0.1 ** 0.1
> -0.7943282347242815
Can someone explain to me what python is doing here?
Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> -0.1 ** 0.1
-0.7943282347242815
>>> a = -0.1; b = 0.1
>>> a ** b
(0.7554510437117542+0.24546092364
25 matches
Mail list logo