Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6977945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:41:30+00:00 2026-05-27T17:41:30+00:00

Similar questions already asked, but please can anyone explain to me why this code…

  • 0

Similar questions already asked, but please can anyone explain to me why this code…

NSInteger hexInt = 0x80000505;
NSLog(@"%d, %#x", hexInt, hexInt);

prints out -2147482363, 0x80000505 while 0x80000505 equals to 2147484933 and not to -2147482363 ?
Thank you…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:41:31+00:00Added an answer on May 27, 2026 at 5:41 pm

    NSInteger is defined as int (typedef int NSInteger) and 2147484933 overflows int maximal value (on 32 bit systems, where the range of int is −2,147,483,648 to +2,147,483,647), because as you can see, the highest bit is set in 0x80000505, so 0x80000505 is a negative number.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked a similar question to this already, but I still can't see the
I know this sounds similar to many questions already asked, but those were answered
I already asked a similar question but this one is a bit different/specific: I'm
I suppose similar questions were already asked, but I was unable to find any.
I know this is a similar question to one already asked, but I was
I've already asked similar question on this issue on stack overflow already, but I
I know similar questions were already asked and answered, but not exactly the same.
I know that similar questions have already been asked here before, but they all
I know that similar questions were already asked many times but mine differs a
I know that similar questions have already been asked but I do not understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.