On Fri, May 03, 2002 at 01:48:38AM +0200, [EMAIL PROTECTED] wrote:
> by now i got it to work, too - but only from within a regular application
> but not from a hack. exactly the same code works gives different results.
                 ^^^^
Oh.  I'm sorry I didn't notice this before.

The Cephes Maths Library uses global variables from time to time.  Hacks
don't have global variables.  Boom!  For example,

>         i=sqrt(i);
>         //2 - works from both appl and hack

sqrt() and the functions it uses happen not to use any globals.

>         i=(float)atan(i);
>         // results to 1 from application (trunced from
> 1,5607966601082313810249815754305)
>         // but to 0 from a hack

But atan() does use some globals, for example, PIO2F, which is a global
constant with the value pi/2.

There are various ways to fix this.  Perhaps the quickest is for you to
write or find your own atan() function that does not use globals.

    John

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

Reply via email to