mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* add a few integer math ops (sqrt, atan) to kernel headers?
@ 2006-04-28 16:36 Rick Niles
  2006-04-28 16:49 ` linux-os (Dick Johnson)
  0 siblings, 1 reply; 2+ messages in thread
From: Rick Niles @ 2006-04-28 16:36 UTC (permalink / raw)
  To: linux-kernel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-28 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-28 16:36 add a few integer math ops (sqrt, atan) to kernel headers? Rick Niles
2006-04-28 16:49 ` linux-os (Dick Johnson)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®