in the _clampWeights, a code fragment iterates over _weights and applies a restriction based on absoluteMin and absoluteMax, which does not take into account values equal to them, but only those outside the range, but judging by the logic of the iteration itself, this is incorrect.
Values less than absoluteMin are first set to absoluteMin and then subtracted from sumRemainerWeight. This implies that a value already equal to absoluteMin should also be subtracted.
Values greater than absoluteMax are set to absoluteMax and added to sumOtherWeights. This suggests that an existing value of absoluteMax should be added as well.
The code iterates through the _weights array and aims to apply boundaries based on absoluteMin and absoluteMax. The error is that it focuses only on values outside the range, overlooking weights already at the boundaries.
The incorrect adjustments to sumRemainerWeight and sumOtherWeights directly lead to an imprecise weight distribution. This can skew the results of the algorithm, especially if there are multiple weights at the minimum or maximum values.
Manual
Use <= , >=
Likelihood: Low, when a weight is perfectly equal to absoluteMin or absoluteMax. Impact: Low, will skew a bit the results of weights.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.