Binary Decimals in Python

Shashwat Anand anand.shashwat at gmail.com
Tue Mar 30 11:19:52 EDT 2010


decimal binary number is not included AFAIK

On Tue, Mar 30, 2010 at 8:43 PM, aditya <bluemangroupie at gmail.com> wrote:

> To get the decimal representation of a binary number, I can just do
> this:
>
> int('11',2) # returns 3
>
> But decimal binary numbers throw a ValueError:
>
> int('1.1',2) # should return 1.5, throws error instead.
>
> Is this by design? It seems to me that this is not the correct
> behavior.
>
> - Aditya
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100330/83596cef/attachment-0001.html>


More information about the Python-list mailing list