[Tutor] ValueError: could not convert string to float: '13,2'

Pierre Dagenais pierre.dagenais at ncf.ca
Mon Jan 20 16:49:35 CET 2014


Not very elegant, but it'll work. I don't suppose there is a
>> function for determining the number of digits after the decimal, is it?
> 
> It looks like you are trying to avoid rounding errors in decimal arithmetic. 
> You might be interested in Python's decimal.Decimal type then.

That's right, I had never heard of decimal.Decimal. I'll check it up.
> 
>> Also, anybody knows the maximum and/or minimum integer python will accept?
> 
> Integers in Python (*) are "unlimited"
> 
>>>> 10**1000 -1
> 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
 99
>  99999999
>  99                                  
> 
> In practice the amount of available memory will be the limit, but you are 
> unlikely to reach that.
> 
> (*) Python 2 had int and long where values that could not represented by 
> machine integers were automatically propagated to long. In Python 3 the int 
> and long have been united as int.

Thank you very much,


More information about the Tutor mailing list