Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / signed and Unsigned?

Author
Message
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 4th Aug 2009 21:06
just wondering am i correct in thinking that if a variable is \"unsigned\" it can only be positive? and signed can be either? i heard that somewhere i think but am not sure.

New Site! Check it out \/
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 4th Aug 2009 21:40
Yep, you are correct. An unsigned variable cannot have a value lower than zero. But an unsigned type of variable is the same size of the signed type.

int = -4,294,967,296 to 4,294,967,296

unsigned int = 0 to 8,589,934,592

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Cole Xemi
16
Years of Service
User Offline
Joined: 20th Aug 2008
Location:
Posted: 5th Aug 2009 00:27
Ranges are wrong

int: -2147483648 to 2147483647;
unsigned int: 0 to 4294967295
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 5th Aug 2009 06:41
Ok Awesome Thanks guys!

New Site! Check it out \/

Login to post a reply

Server time is: 2024-10-01 10:28:40
Your offset time is: 2024-10-01 10:28:40