I have Double data type, cause I need result with floating number, but if my result is negative, it broke all my algorithm. Is there maybe a unsigned data type with floating point?

I have Double data type, cause I need result with floating number, but if my result is negative, it broke all my algorithm. Is there maybe a unsigned data type with floating point?

Use max to limit numbers from going below zero:
let posOrZero = max(possiblyNegative, 0)
If possiblyNegative is above zero, it's going to be the result of max; Otherwise, zero is returned.