Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #833

Re: calculating the power of a fixed point

From Dann Corbit <dcorbit@connx.com>
Newsgroups comp.programming
Subject Re: calculating the power of a fixed point
Date 2011-09-20 12:09 -0700
Organization Aioe.org NNTP Server
Message-ID <MPG.28e2849671fbcb97989684@aioe.org> (permalink)
References <2d2836aa-2443-4e56-9fef-d38e12c60dcf@z41g2000yqb.googlegroups.com>

Show all headers | View raw


In article <2d2836aa-2443-4e56-9fef-
d38e12c60dcf@z41g2000yqb.googlegroups.com>, kerenpur@gmail.com says...
> 
> Hello!
> I want to represent x and y, both non-integers as a fixed point data
> type
>  I am having trouble calculating x^y without using the float library
> in C++
> because the standard library includes only a floating point
> implementation of the power function

http://focus.ti.com/general/docs/lit/getliterature.tsp?
literatureNumber=spra619&fileType=pdf

"General Guide to Implement Logarithmic and Exponential Operations on a 
Fixed-Point DSP"


Also:
http://www.velocityreviews.com/forums/t717009-fixed-point-
implementation-of-c-exponent-function.html

At the bottom of the page a post by thadula includes code for several 
fixed point math functions which may be useful.

This thread may have something useful in it:
http://coding.derkeiler.com/Archive/C_CPP/comp.lang.c/2008-
03/msg01843.html

This link:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.92.5605
&rep=rep1&type=pdf

looks like it might be useful.

I did not try it, but this seems interesting (though it seems that a lot 
of iterations were necessary):
http://www.ehow.co.uk/how_6563047_use-fixed-point-calculate-
exponentiation.html

And, of course, cordic calculations are a classic:
http://www.dcs.gla.ac.uk/~jhw/cordic/index.html
http://people.sc.fsu.edu/~jburkardt/m_src/cordic/cordic.html
http://www.quinapalus.com/efunc.html

Back to comp.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

calculating the power of a fixed point Keren Davidpur <kerenpur@gmail.com> - 2011-09-20 02:00 -0700
  Re: calculating the power of a fixed point "BartC" <bc@freeuk.com> - 2011-09-20 12:01 +0100
    Re: calculating the power of a fixed point "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2011-09-20 14:36 +0200
      Re: calculating the power of a fixed point Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-21 03:52 +0100
        Re: calculating the power of a fixed point "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2011-09-21 10:36 +0200
      Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-23 04:03 -0700
        Re: calculating the power of a fixed point Ike Naar <ike@sverige.freeshell.org> - 2011-09-23 11:52 +0000
          Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-23 08:59 -0700
            Re: calculating the power of a fixed point Ike Naar <ike@sverige.freeshell.org> - 2011-09-23 22:46 +0000
              Re: calculating the power of a fixed point Patricia Shanahan <pats@acm.org> - 2011-09-23 16:58 -0700
                Re: calculating the power of a fixed point "BartC" <bc@freeuk.com> - 2011-09-24 12:58 +0100
                Re: calculating the power of a fixed point Patricia Shanahan <pats@acm.org> - 2011-09-24 07:18 -0700
                Re: calculating the power of a fixed point Jongware <jongware@no-spam.plz> - 2011-09-26 11:03 +0200
                Re: calculating the power of a fixed point "BartC" <bc@freeuk.com> - 2011-09-26 10:40 +0100
                Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-10-01 03:51 -0700
                Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-10-01 03:44 -0700
                Re: calculating the power of a fixed point glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-10-01 10:56 +0000
                Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-10-01 07:00 -0700
                Re: calculating the power of a fixed point glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-10-01 18:04 +0000
                Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-10-01 16:27 -0700
                Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-10-02 00:19 -0700
                Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-10-02 00:24 -0700
  Re: calculating the power of a fixed point Dann Corbit <dcorbit@connx.com> - 2011-09-20 12:09 -0700
  Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-22 03:21 -0700
  Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-23 04:07 -0700
    Re: calculating the power of a fixed point Peter Flass <Peter_Flass@Yahoo.com> - 2011-09-23 08:17 -0400
      Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-23 08:30 -0700
    Re: calculating the power of a fixed point glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-09-23 12:39 +0000
      Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-23 08:44 -0700
        Re: calculating the power of a fixed point glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2011-09-23 17:07 +0000
          Re: calculating the power of a fixed point Robin Vowels <robin.vowels@gmail.com> - 2011-09-23 19:17 -0700

csiph-web