Ask HN: Can you increment a counter for units that decay?

1 points by RichardHeart ↗ HN
You have a pantry with food in it that expires at different dates. Each "food" is 1 unit. The expiration dates are random. When you added a new piece of food to your panty, how would you increment your "FoodDaysRemaining."

I think you end up with this: https://en.wikipedia.org/wiki/Piecewise_linear_function but I don't think you can represent that efficiently with something you can increment?

0 comments

[ 3.2 ms ] story [ 10.5 ms ] thread

No comments yet.