Datatype of non-negative values

Larry Bates lbates at syscononline.com
Wed Feb 9 11:46:12 EST 2005


What exactly do you want to happen when result
would be negative?  I'll guess be zero:

pseudocode:

x=value
x=max(x-something, 0)

That way if it goes negative, it sticks to zero.

Larry Bates


Dirk Hagemann wrote:
> Hi,
> 
> Is there a datatype in python which allows no negative values? I
> subtract several times something from a value and I don't want to chek
> everytime if this value is still bigger or equal 0.
> 
> Thanks for help!
> Dirk Hagemann



More information about the Python-list mailing list