本文介绍了ANSI C的正弦代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 你好 我下载了glibc并尝试寻找实现 正弦函数的代码 i无法找到该文件。 i进入数学目录并找到math.h ..我想这需要为正弦函数包含 。但是哪个.c文件实现了 正弦/余弦和其他触发器 谢谢 解决方案 suri写道: 我下载了glibc并尝试寻找实现正弦函数的代码我无法找到该文件。我去了数学目录,找到了math.h ..我想这需要包含在正弦函数中。但是哪个.c文件实现了正弦/余弦和其他触发器 http://www.eskimo.com/~scs/C-faq/q14.3.html 你真的想要一个罪的实现吗? 显然,你正在运行一个与英特尔兼容的处理器,它带有一个b $ b附带的处理器用硬件实现的sin指令。 我不知道常见问题。 我的问题是正弦函数在哪里? 因为你说它的原生指令集意味着没有代码用于实现正弦的 ansi C.? 井libm.a必须一定有它。但是C文件在哪里? Nudge写道: suri写道: I下载glibc并尝试寻找实现正弦函数的代码我找不到文件。我去了数学目录并找到了math.h ..我想这需要是包括正弦函数。但是哪个.c文件实现了正弦/余弦和其他触发器 http://www.eskimo.com/~scs/C-faq/q14.3.html 你真的想要一个罪的实现吗? 显然,你正在运行一个兼容英特尔的处理器,它带有一个用硬件实现的sin指令。 suri写道:不,我知道常见问题。我的问题在于哪里是正弦函数?因为你说它是一个本地人指令集意味着 ansi C中没有用于实现正弦的代码。 有些平台有硬件指令来计算sin()和 编译器会发出它们,绕过libm库的实现。这个 对于ia32和ia64来说非常正确。 很好libm.a肯定有它。但是C文件在哪里? 对于FreeBSD,请查看/usr/src/lib/libm/common/{trig.h,sincos.c} [讨厌 查看代码,但它的工作速度很快。]如果你真的那么,你最好还是拿一本 微积分书来看一下泰勒系列扩展/> 想要了解数学。或者查看C中的数字食谱。 HelloI downloaded glibc and tried looking for the code that implements thesine functioni couldnt find the file.i went to the math directory and found math.h.. i guess that needs to beincluded for the sine function. but which .c file implements thesine/cosine and other trig fnsthanks 解决方案 suri wrote: I downloaded glibc and tried looking for the code that implements the sine function i couldnt find the file. i went to the math directory and found math.h.. i guess that needs to be included for the sine function. but which .c file implements the sine/cosine and other trig fns http://www.eskimo.com/~scs/C-faq/q14.3.htmlDo you really want an implementation for sin?Apparently, you are running an Intel-compatible processor whichcomes with a sin instruction implemented in hardware. No i knew that faq.my question is where is the sine fn imlementation?since u say its a native instruction set means that there is no code inansi C for implementing sine.?well libm.a must surely have it. but where are the C files?Nudge wrote: suri wrote:I downloaded glibc and tried looking for the code that implements thesine functioni couldnt find the file.i went to the math directory and found math.h.. i guess that needs to beincluded for the sine function. but which .c file implements thesine/cosine and other trig fns http://www.eskimo.com/~scs/C-faq/q14.3.html Do you really want an implementation for sin? Apparently, you are running an Intel-compatible processor which comes with a sin instruction implemented in hardware.suri wrote: No i knew that faq. my question is where is the sine fn imlementation? since u say its a native instruction set means that there is no code in ansi C for implementing sine.?Some platforms have hardware instructions that compute sin() and thecompiler will emit them, bypassing the libm library''s implementation. Thisis pretty much true for ia32 and ia64. well libm.a must surely have it. but where are the C files?For FreeBSD, check out /usr/src/lib/libm/common/{trig.h,sincos.c} [nastylooking code, but it works fast.] You''re almost better off grabbing acalculus book and having a look at a Taylor series expansion if you trulywant to understand the math. Or look at "Numerical Recipes in C". 这篇关于ANSI C的正弦代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-06 06:49