From a59a667a46caa9709dcb7c8b003e613d1db75193 Mon Sep 17 00:00:00 2001 From: hahwu <31872165+hahwu@users.noreply.github.com> Date: Wed, 19 Mar 2025 12:27:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/GoUtil/mathUtil.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/GoUtil/mathUtil.go b/src/server/GoUtil/mathUtil.go index d2f17d6a..709ff822 100644 --- a/src/server/GoUtil/mathUtil.go +++ b/src/server/GoUtil/mathUtil.go @@ -4,5 +4,8 @@ func RandNum(start int, end int) int { if start > end { return 0 } + if start == end { + return start + } return start + GetRand().Intn(end-start+1) }