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

Optimize spx rand #1213

Closed
nighca opened this issue Jan 8, 2025 · 0 comments · Fixed by #1227
Closed

Optimize spx rand #1213

nighca opened this issue Jan 8, 2025 · 0 comments · Fixed by #1227
Assignees

Comments

@nighca
Copy link
Collaborator

nighca commented Jan 8, 2025

https://github.com/goplus/builder/pull/1212/files#r1906657692

这个姿势其实挺不好用的,如果要生成一个 1-10 的非整数,试了下目前没有好的办法

如果 rand(1.0, 10.0),gop 还是会把它当成 rand(int, int)

如果 rand(float64(1), float64(10)),则运行会报错

cannot use float64(1) (constant 1 of type float64) as int value in argument to spx.Rand__0 Code: 2

感觉是个 gop 的 bug

@aofei aofei self-assigned this Jan 9, 2025
aofei added a commit to aofei/.goplus.builder that referenced this issue Jan 13, 2025
aofei added a commit to aofei/.goplus.builder that referenced this issue Jan 13, 2025
@nighca nighca closed this as completed in 0081d7d Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants