Skip to content

Commit 15ea16c

Browse files
Update docs/architecture-decisions/high-precision-fractional-bucketing.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Michael Beemer <[email protected]>
1 parent 4f0f886 commit 15ea16c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/architecture-decisions/high-precision-fractional-bucketing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func calculateBucketAllocations(variants []fractionalEvaluationVariant, totalWei
186186
allocations[i] = bucketAllocation{variant: variant.variant, buckets: 0}
187187
} else {
188188
// Calculate proportional allocation
189-
proportional := int(float64(variant.weight) / float64(totalWeight) * bucketCount)
189+
proportional := int((int64(variant.weight) * bucketCount) / int64(totalWeight))
190190
// Ensure minimum allocation of 1 bucket for any positive weight
191191
buckets := max(1, proportional)
192192
allocations[i] = bucketAllocation{variant: variant.variant, buckets: buckets}

0 commit comments

Comments
 (0)