What happens if the RecipeChange reduces the amount of an ingredient all the way to zero?
How does for example the customer choosing their favorite food work if an excludedIngredient is zero in a recipe? To quote the spec: “The resulting value is always rounded down to a full integer but must remain positive.“ but is 0 considered positive? Should we round up to 1 in this case?
1 Like
It can’t reach zero. “Must remain positive” means > 0, and 0 is not positive, so the value is floored to a full integer and then clamped at 1: max(1, floor(amount * (1 + adaptation/100))).
“The resulting value is always rounded down to a full integer but must remain positive.”
2 Likes