Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Math in Rockbox

Re: Math in Rockbox

From: Tomas <tomas_at_salfischberger.nl>
Date: Wed, 06 Jul 2005 17:53:54 +0200

well... If I just think of a q&d solution:

long exp10(int x) {
    long result = 10;
    while (--x) {
        result = result * 10;
    }
    return result;
}

I haven't tested this, but it can be something like this. (And I'm sure
it's slow as hell for large values of x)

Tomas

lear_at_algonet.se wrote:

>Hi,
>
>For an upcoming patch, I need some fixed- or floating-point math. Does anyone have
>a good fixed-point implementation of pow(10, x) (or exp10(x)), or some hints
>on how to implement it? It doesn't need to be particularly fast; small size
>is to be preferred actually.
>
>Or would it be acceptable to bring in the compiler's floating point stuff for
>this? The idea is to not put it in a plugin or a codec (though I could put
>it in the codec lib, it isn't really the natural place for it :)...
>
> Magnus
>
>_______________________________________________
>http://cool.haxx.se/mailman/listinfo/rockbox
>
>

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2005-07-06

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy