问题评论
解决方案评论
-
3条评论
Lucinda Kingon 31 Jan 2017
我要么生气,要么测试1被打破...(很可能是前者!)有人可以帮忙吗?
尤伦2017年6月7日
It's probably a roundoff error in the calculation of the angle (in degrees) by acosd, which causes the end-result to have a slight offset (in the 7th or 8th decimal, which is not printed on-screen but which is there) from the exact correct answer. So instead, use the identity "(sin(x))^2 + (cos(x))^2 = 1" in order to eliminate the use of sin and cos in your calculation.
大卫·维雷利(David Verrelli)on 20 Jun 2018
露辛达·金(Lucinda King),您提出了一个公平的观点:最好是测试套件应允许使用这些“轻微偏移”,这些“轻微偏移”是在使用浮点数时会创建的。特别是当“正确”答案不是整数时。 [See e.g. Problem 44690.]
-
1条评论
Lucinda Kingon 31 Jan 2017
为什么2.5000不等于2.5?