Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

貌似是一个 bug? #123

Closed
figurexyang opened this issue Aug 29, 2024 · 1 comment · Fixed by #141
Closed

貌似是一个 bug? #123

figurexyang opened this issue Aug 29, 2024 · 1 comment · Fixed by #141

Comments

@figurexyang
Copy link

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)

@houmy555809
Copy link
Contributor

你直接发布 pull requests 吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants