More int and float attributes

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sat Aug 5 16:49:47 EDT 2006


Paddy:
> Or do you mean the ability to choose between hardware supported float
> s? e.g. float and double precision?

No, I mean just having the ability to ask the float (his attribute)
what are the max and min values it can represent, etc.

stop = float.max
...

I don't know any simple way to know that values now. And importing sys
to know the max int looks stupid.

maxi = int.max
mini = int.min
...

Such attributes can be given to the Decimal values too, if you want.

Bye,
bearophile




More information about the Python-list mailing list