提交 d370162c 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix a random issue

上级 8f0e8b50
......@@ -44,7 +44,7 @@ func GenerateIntItemsByStep(start int64, end int64, step int, repeat int) []inte
func GenerateIntItemsRand(start int64, end int64, step int, repeat int) []interface{} {
arr := make([]interface{}, 0)
countInRound := (end - start) / int64(step)
countInRound := (end - start) / int64(step) + 1
total := 0
for i := int64(0); i < countInRound; {
rand := commonUtils.RandNum64(countInRound)
......
......@@ -40,7 +40,7 @@ func GetRandFromRange(dataType, start, end, step, repeatStr, precisionStr string
stepInt = stepInt * -1
}
countInRound := (endInt - startInt) / stepInt
countInRound := (endInt - startInt) / stepInt + 1
for i := 0; i < count; i++ {
rand := commonUtils.RandNum64(countInRound)
......@@ -66,7 +66,7 @@ func GetRandFromRange(dataType, start, end, step, repeatStr, precisionStr string
stepInt = stepInt * -1
}
countInRound := (int64(endChar) - int64(startChar)) / stepInt
countInRound := (int64(endChar) - int64(startChar)) / stepInt + 1
for i := 0; i < count; i++ {
rand := commonUtils.RandNum64(countInRound)
......@@ -92,7 +92,7 @@ func GetRandFromRange(dataType, start, end, step, repeatStr, precisionStr string
stepFloat = stepFloat * -1
}
countInRound := (endFloat - startFloat) / stepFloat
countInRound := (endFloat - startFloat) / stepFloat + 1
for i := 0; i < count; i++ {
rand := commonUtils.RandNum64(int64(countInRound))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册