> Code based on yours works fine for me.
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.
this seems pretty strange to me...

anyone any ideas? john? ;)

ciao,
felix


    {
        int i;
        DbgBreak();

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

        StrIToA(outputstringarray, i);
        WinDrawInvertedChars(outputstringarray, 3, 100, 60);

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

        StrIToA(outputstringarray,i);
        WinDrawInvertedChars(outputstringarray, 3, 100, 80);

    }




"John Marshall" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:85410@palm-dev-forum...
>
> On Wed, May 01, 2002 at 04:29:03PM +0200, [EMAIL PROTECTED] wrote:
> > has anyone ever managed to get trigonometric functions like sin cos or
atan
> > to work using only mathf.h / libmf.a included with prc-tools
>
> Code based on yours works fine for me.
>
> > the trigonometrics
> > always give 0 (prc-tools2.1, random crap value with prc-tools2.0).
>
> (There is as yet no such thing as prc-tools 2.1.)
>
> >         float v, t1;
> >
> >         t1=1;
> >
> >         v=atan(t1);
> >
> >         //v is 0 now but should be 0,78539816339744830961566084581988
> [...]
> >             StrIToA(outputstringarray2, (Int16)v);
>
> How do you know v is 0 at this point?
>
> If you're printing it out via StrIToA(foo,(Int16)v) then of course the
> cast will print 0.785398...  as 0.
>
> Try writing "t1=1.0" instead.  If this fixes v, you'll know that you are
> actually using the ancient and buggy prc-tools 2.0.
>
> Otherwise I don't have any interesting ideas:  similar code to yours
> printed 0.0, 0.7853, 45.0 just fine (well, actually I printed out
> (long)(1000000L * x), which is an easy quick and nasty way to dump the
> values of floating point variables on Palm OS).
>
>     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