Ive come accross some issues with floats and casting etc. Make sure you add
a float part as said before ie not 10 but 10.0. Also if you cast anything to
floats in a equation make sure you bracket everthing up to the point of
being over the top. I cant exactly remember the problem but i think it was
somthing like this:

        int a = 20;
        float b  = 30.0;
        float c;


        c = (float)a * b;    but the calculation was done in integer, and
then cast to a float

I solved it by

        c = ((float)a) * b;

this may of not been the exact senario, but it was something like this with
the casting. Compiler Bug ???

Regards,

Rik

> -----Original Message-----
> From: Dave Lippincott [SMTP:[EMAIL PROTECTED]]
> Sent: 19 July 2001 14:16
> To:   Palm Developer Forum
> Subject:      Re: unsigned float?
> 
> You definitely have a bug in your code.  As already pointed out, 32768 is
> well within the range of a double or even float.
> 
> ----- Original Message -----
> From: "JF" <[EMAIL PROTECTED]>
> Newsgroups: palm-dev-forum
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 10:06 PM
> Subject: Re: unsigned float?
> 
> 
> > Oh and I tried it as a double, which I know is 8 bytes, but it STILL
> > basically turns negative after 32768 ( 8 ^ 5)... Any ideas??
> >
> > Thanks,
> > Jason
> >
> 
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/

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

Reply via email to