-
Notifications
You must be signed in to change notification settings - Fork 3
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
关于改进计算方式 #2
Comments
您的issue已收到!非常感谢您的建议,抱歉这么久才回复。 我将尽快进行研究,👍 |
感谢认可,但最为推荐的做法是通过python这种无视精度限制的脚本,js只能判定是否可能存在结果。我在leetcode测试过了,虽然计算的结果是1024,但leetcode不是通过js计算的。我正在尝试用wasm解决 |
不知大佬是否有意向成为Collaborator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
感谢开发者,已经获得了限定勋章😁。使用过程中我发现计算结果出现了多次重复,下面是测试用例:
计算代码中(快速计算)出现了比较多的嵌套循环结构和
eval
,比较影响效率。我参考了Heap's algorithm方法重写了排列组合方法,它不用花费额外的空间,并且执行效率蛮高的,并且做了去重处理:下面是benchmarkJS的测试比较两种计算代码:
结果:
另外我发现用js实现存在一部分值被忽略了,比如下面的值:
我推测是因为js的位运算支持32位数字,右移过多会出现诡异的bug。目前还没有解决的方法。
The text was updated successfully, but these errors were encountered: