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
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to