On 2006-02-17, Thomas Okken <[EMAIL PROTECTED]> wrote:
> I have an existing PalmOS application, targeted at PalmOS 3.0 and later, and
> developed using PRC-tools. The app is a calculator, and it uses the
> native "double" data type (with MathLib.prc to provide transcendentals).
> In order to convert "double" to "string" and vice versa, my code currently
> uses a couple of self-made routines based on lookup tables: these tables
> store all representable powers of 2 in 20 decimal digits, to aid the
> binary<->decimal conversion.
>
> I would like to start using "long double" instead of "double", but this will
> make the look-up table rather large, and that would probably make the
> calculator impractical on 2 MB machines.
>
> The libc provided with the PalmOS SDK is very limited and does not support
> floating-point conversions. Is there freely reusable code available to
> do these conversions, or will I have to go back to the drawing board and
> create my own conversion routines?
>
> Thanks for any insights,
>
>  - Thomas
>

The PRC-Tools libc *does* support floating point conversions, albeit 
effectively only for single precision (C-type float).
The reason was to save space on the memory limited older Palms.

If you want better support for double (and long double) just pick the 
relevant functions from any glibc distribution. See
        http://www.gnu.org/software/libc/libc.html

If you do a lot of calculations with long double (96 bits) things can get 
very slow on a PalmOS 3.x machine. You would also have to port MathLib
to long double.

HTH

Ton van Overbeek

-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to