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

# 你的红包算法我运行发现有溢出的红包金额产生。 #143

Open
troublrMan opened this issue Feb 24, 2019 · 4 comments
Open

Comments

@troublrMan
Copy link

No description provided.

@troublrMan
Copy link
Author

image

@crossoverJie
Copy link
Owner

@troublrMan

请描述下预期与实际结果

@troublrMan
Copy link
Author

如图所示,2000的红包100个人分,按照你最大的红包金额 应该不会产生超过500的金额的最大红包,但是实际上运行的结果可以看上面的截图产生了 1250这样数额的红包。

@crossoverJie
Copy link
Owner

@troublrMan

这是由于前面随机分配的金额较小,导致最后一份肯定就是总价剩余的,有可能就会大于预设的最大值。

可以适当提高最小金额 MIN_MONEY

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

No branches or pull requests

2 participants