lkml.org 
[lkml]   [2006]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectadd a few integer math ops (sqrt, atan) to kernel headers?
Date
Forgive me if it's already in the kernel somewhere, but I need some basic (large) integer based math functions for a GPS device driver I maintain (OSGPS on sourceforge)and I've got to wonder if other drivers might be able use them.  Right now we have: sqrt(x), atan2(y, x), and rss(x,y) [root-sum-squared].  The functions just deal with large integers to compute anything reasonable.  Of course they're approximations since the output has to be an integer. The atan2() function returns an angle such that 1 radian == 16384.  It seems like these should go in some integer math kernel header file for everyone to use.

I know what some of you are thinking right now. That sort of math belongs in userspace, but to close a correlator tracking loop in real-time you need it in the device driver. Either than or require your userland program be a real-time program, which I'd rather not do.

They're all less than 30 lines long. If people think this is a good idea, then I can submit a patch. Suggestions about what to call this header file or where to put it are appreciated. Also, if anyone wants to add more functions or improve the algorithm we use that would also be nice.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-28 18:38    [W:0.036 / U:2.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site