From: john@jjdev.com (John de la Garza)
To: kernelnewbies@lists.kernelnewbies.org
Subject: pow calculation in kernel
Date: Thu, 19 Jun 2014 22:40:53 -0400 [thread overview]
Message-ID: <20140620024052.GA4906@vega.jjdev.com> (raw)
In-Reply-To: <tencent_7D08EA5C1EE391661E9C933E@qq.com>
On Fri, Jun 20, 2014 at 09:55:02AM +0800, ?? wrote:
> Hi:
>
> I am doing a research on D2TCP(http://dl.acm.org/citation.cfm?id=2342388), I just want to implement it into the linux kernel. When calculating the penalty function, it is p = a^d, where 0< a < 1 and 0< d < 1. Since the kernel only offers integer, so in my code, so I let a multiply 2^10. But I have no idea of calculating a^d when 0< d < 1. May be I want a approximate algorithm or other methods. Can you help me ?
> thanks~
>
Could you achieve this using fixed point math?
you can see an example in include/linux/sched.h
(search for CALC_LOAD)
prev parent reply other threads:[~2014-06-20 2:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 1:55 pow calculation in kernel =?gb18030?B?1cXqzw==?=
2014-06-20 2:40 ` John de la Garza [this message]
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=20140620024052.GA4906@vega.jjdev.com \
--to=john@jjdev.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).