为什么 math.h 没有定义倒数三角函数?
我在 C 编程语言中发现了一些类似的东西;非常容易提供的东西,破坏旧代码的机会很小,并且有明显的标准化方法。极简主义是原因吗?
I find little things like this throughout the C programming language; something that is very easy to provide, has very little chance of breaking old code, and has an obvious way to standardize it. Is minimalism the reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因为如果您有“标准”三角函数,那么计算它们就很简单了?
Because they're trivial to compute if you have the "standard" trig functions?
倒数是指弧函数吗?它们被定义为
asin()
、acos()
和atan()
(以及atan2()
)如果您指的是 1/cos()、1/sin() 和 1/tan(),那么实现这些函数是一项微不足道的练习,但处理错误检查(sin() != 0 等)则要复杂得多对于一个大型图书馆来说,付出的努力比它值得。
By reciprocal, do you mean the arc functions? They're defined as
asin()
,acos()
andatan()
(andatan2()
)If you mean 1/cos(), 1/sin() and 1/tan(), implementing these functions is a trivial exercise, but dealing with error checking (sin() != 0, etc. etc.) is far more effort than it's worth for a major library.