SOLVED Easy way to clamp to 0 after a certain number has been reached?

Hi,
I have the variable speed = 8
In my step its: speed *= 0.9;
and I want it to jump to 0 after its below 1.

Do I always have to write
if (speed < 1) speed = 0; ?
or is there an easy function like clamp, min, max etc.
 
Oh, yea I could have phrased my question a bit better. Is there a built in function that does what my if statement does? e.g. clampbelow(clampat, clampto) / clampbelow(1, 0);
But now that I think about it I could also just write my function... haha
Thanks Anyway!
 
Top