-
Notifications
You must be signed in to change notification settings - Fork 2
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
关于开平方蒙特卡罗法例程 #6
Comments
因为这个是根据sqrt(x)在[0, 2]的定积分结果推出的表达式,只能得到sqrt(2),如果想得到其他平方根可以更换积分区间再同理倒推 |
其实想求a的平方根就可以取区间[0, a],返回(3 * a * sum) / (2 * times)就是要求的结果 |
好厉害😍😍😍 |
雀氏厉害 @litterqi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这个程序中,函数返回值的表达式具有特殊性,只适用于求2的平方根的情况。
可能🤔具有一定的迷惑性。
但其正确性是毋庸置疑的👍。
显然,系数2除以c(此时为2)的平方根的结果恰好为c(即2)的平方根
The text was updated successfully, but these errors were encountered: