mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rick Niles <niles@rickniles.com>
To: <linux-kernel@vger.kernel.org>
Subject: add a few integer math ops (sqrt, atan) to kernel headers?
Date: Fri, 28 Apr 2006 12:36:09 -0400 (EDT)	[thread overview]
Message-ID: <200604281636.MAA06562@arkroyal.cnchost.com> (raw)

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.

             reply	other threads:[~2006-04-28 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-28 16:36 Rick Niles [this message]
2006-04-28 16:49 ` linux-os (Dick Johnson)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200604281636.MAA06562@arkroyal.cnchost.com \
    --to=niles@rickniles.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®