Sunday, July 31, 2011

Re: [android-developers] Resources.getColor() return type is too small

On Sun, Jul 31, 2011 at 9:13 AM, Olivier Guilyardi <list@samalyse.com> wrote:
> How comes Resources.getColor() returns an int? This can't hold the maximum value
> of 0xFFFFFFFF because Java int is signed.

An int can hold 0xFFFFFFFF, because an int is 32 bits, and 0xFFFFFFFF
is a 32-bit value. From a mathematics perspective, 0xFFFFFFFF is a
negative number in Java.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment