Jonathan Barbero wrote:
> Hello!
>   My name is Jonathan, i´m new with Python.
> 
>    I try this in the command line:
>   
>    >>> (-1)**(1/2)
>     1
> 
>    This is wrong, i think it must throw an exception.
>     What do you think?

>>> 1/2
0
>>> (-1)**0
1

It's fine.

If you want to get a floating point result from dividing,
make one of the two numbers a float:

>>> 1.0/2
0.5
>>>

Georg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to