decayLinear function

DecayFn decayLinear(
  1. double coef
)

Applies a fractional coefficient to the value of the current tag, rounding down. It erases the tag when the result is zero.

Implementation

DecayFn decayLinear(double coef) {
  return (value) {
    final v = (value.value * coef).floor();
    return (v, v <= 0);
  };
}