From e4f781798c07d9a79b60878e75abbce67865f5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=90=A6?= Date: Wed, 22 Apr 2026 18:46:54 +0800 Subject: [PATCH] fix: floating-point issue for averageLoad --- consistent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consistent.go b/consistent.go index 071dc8a..90df676 100644 --- a/consistent.go +++ b/consistent.go @@ -177,7 +177,7 @@ func (c *Consistent) averageLoad() float64 { return 0 } - avgLoad := float64(c.partitionCount/uint64(len(c.members))) * c.config.Load + avgLoad := float64(c.partitionCount) / float64(len(c.members)) * c.config.Load return math.Ceil(avgLoad) }