I have a calculation that goes like this:
$$\text{<any positive number>} - 100$$
As long as the result is a positive number it is acceptable.
However, if the result is a negative number, I need the outcome to calculate to zero. A negative number is not permissible.
Is such a formula possible?
Update 1
This is for use in a CSS calc function .
.class { margin-top: calc(100vh - 100px); }
I don't want the margin to ever be negative.
The function accepts only basic math operators (+, -, /, *).
Update 2
Some have mentioned in the comments that this question is more about CSS than math, and belongs in Stack Overflow.
However, this question is seeking a mathematical formula which has nothing to do with CSS (or coding, for that matter). It just happens to go into a CSS function.
calcfunction only accepts addition (+), subtraction (-), multiplication (*) and division (/). https://www.w3.org/TR/css3-values/#calc-notation – Michael Benjamin Feb 24 '16 at 20:15widthandheightdo not allow negative values. So regardless of thecalcresult, it can never be less than zero, and this question wouldn't be necessary. Some properties, however, such asmargin, do take negative values. – Michael Benjamin Feb 24 '16 at 20:31