You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vector.py 文件内56-57行:
if mode == VectorRandomMode.repeatable:
result = [[random.randint(x, y) for x, y in zip(offset, length)] for _ in range(num)]
elif mode == VectorRandomMode.float:
result = [[random.uniform(x, y) for x, y in zip(offset, length)] for _ in range(num)]
这里是否有问题?random.randint(x,y)与random.uniform(x, y)的返回的值范围是[x,y],而offset, length对应的是左端点和长度。应该改为:
result = [[random.randint(x, x+y) for x, y in zip(offset, length)] for _ in range(num)]
result = [[random.uniform(x, x+y) for x, y in zip(offset, length)] for _ in range(num)]
vector.py 文件内56-57行:
if mode == VectorRandomMode.repeatable:
result = [[random.randint(x, y) for x, y in zip(offset, length)] for _ in range(num)]
elif mode == VectorRandomMode.float:
result = [[random.uniform(x, y) for x, y in zip(offset, length)] for _ in range(num)]
这里是否有问题?random.randint(x,y)与random.uniform(x, y)的返回的值范围是[x,y],而offset, length对应的是左端点和长度。应该改为:
result = [[random.randint(x, x+y) for x, y in zip(offset, length)] for _ in range(num)]
result = [[random.uniform(x, x+y) for x, y in zip(offset, length)] for _ in range(num)]
这个bug可以通过下面这个样例发现:
Vector.random(100,[(7,8)],vector.VectorRandomMode.repeatable)
The text was updated successfully, but these errors were encountered: