Re: Strange issue when converting from hex to float
Re: Strange issue when converting from hex to float
- Subject: Re: Strange issue when converting from hex to float
- From: Andy Lee <email@hidden>
- Date: Thu, 21 Jul 2005 14:57:19 -0400
On Jul 21, 2005, at 2:52 PM, Ian was here wrote:
I've tried several combos and they all yield a value
of zero.
float fAlpha = alphaComp / 255.0f;
float fAlpha = (float)alphaComp /
255.0f;
float fAlpha = alphaComp / 255.0;
I don't know my operator precedences offhand, but I usually do
something like:
float fAlpha = ((float)alphaComp) / 255.0f;
or even:
float fAlpha = ((float)alphaComp) / 255;
I'm pretty sure you want to force the cast to float with that first
set of parens.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden