robin_wxg
驱动小牛
驱动小牛
  • 注册日期2003-02-10
  • 最后登录2009-09-21
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望6点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
阅读:1328回复:1

请教:如何在linux内核态调用正弦函数等数学公式?

楼主#
更多 发布于:2004-05-08 17:47
我在做图象设备驱动时要用到正弦函数、余弦函数等,但好象可以编译通过,不能加载driver,请问各位该如何在这种情况下调用这些数学公式呢?如sin(),cos()...
robin_wxg
驱动小牛
驱动小牛
  • 注册日期2003-02-10
  • 最后登录2009-09-21
  • 粉丝0
  • 关注0
  • 积分60分
  • 威望6点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-05-08 18:24
网站上这样讲:
VINOD GOPAL wrote:
Hi,
I am new to linux world and this mailing list.

I need to use the arithmetic functions like sin, cos,
exp, log, etc in linux device driver.

On search read , not to use libm from kernel driver
as it will harm the fpu registers.
Do you have any insight how to support these
functions in linux driver or any code that is
available which I can make use of?

I\'d recommend using fixed denominator rational numbers to represent real numbers and polynomial approximations for the transcendental functions. We do this in our EBS scheduler patches and it seems to be successful. The main downside to this approach is the limited range (and precision) of values that can be represented so you need to have a clear idea of the likely values at various stages of your calculations.

The \"Handbook of Mathematical Functions\" by Abramowitz and Stegun, Dover Publications, New York ISBN 486-61272-4 (LCN 65-12253) is a good source of methods for approximating functions.

If you\'d like more detailed assistance don\'t hesitate to ask.

Peter
游客

返回顶部