How many bytes would you need to store 2^57,885,161 - 1 as an integer?
How many bytes would you need to store 2^57,885,161 – 1 as an integer?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Assuming we’re doing two’s complement and that 8 bits is equal to one byte; we’d need at least (57,885,161+7)/8 bytes.
If you needed a simple way to possibly explain it is by using mathematical induction that says 2^32 – 1 is the maximum number that a 32-bit integer would represent, and 32 is a base of 2 that is divisible by 8, our assumed number of bits per byte. 2^32 – 1 would be 4 bytes.
Extending this definition of assumptions you have the number 2^57885161 which isn’t divisible by 8, but adding 7 to it is. So you’re left with 2^57885168, and when you divide it by 8 you get the resultant 7235646 bytes.
This is just an explanation of GregS’s comment.