1378
votes

I can never remember the number. I need a memory rule.

18
  • 48
    unsigned: 2³²-1 = 4·1024³-1; signed: -2³¹ .. +2³¹-1, because the sign-bit is the highest bit. Just learn 2⁰=1 to 2¹⁰=1024 and combine. 1024=1k, 1024²=1M, 1024³=1G
    – comonad
    Mar 28, 2011 at 20:01
  • 31
    I generally remember that every 3 bits is about a decimal digit. This gets me to the right order of magnitude: 32 bits is 10 digits.
    – Barmar
    Oct 2, 2013 at 15:11
  • 8
    @JoachimSauer it can certainly help debugging if you learn to at least recognize these kinds of numbers.
    – Dunaril
    Nov 13, 2013 at 16:38
  • 72
    "if a disk becomes full, deleting all mbytes will archive" (2 letters, 1 letter, 4 letters, 7 letters, 4 letters, 8 letters, 3 letters, 6 letters, 4 letters, 7 letters) Mar 11, 2014 at 14:30
  • 8
    A case, when the int32 is not enough: bbc.com/news/world-asia-30288542 Dec 4, 2014 at 20:14

45 Answers 45

5058
votes

It's 2,147,483,647. Easiest way to memorize it is via a tattoo.

13
  • 83
    My mnemonic: 2^10 is very near to 1000, so 2^(3*10) is 1000^3 or about 1 billion. One of the 32 bits is used for sign, so the max value is really only 2^31, which is about twice the amount you get for 2^(3*10): 2 billion.
    – 16807
    Dec 3, 2013 at 22:24
  • 164
    2147483647 without commas.
    – Vern D.
    Feb 5, 2016 at 20:22
  • 3
    @AbhimanyuAryan Imagine it as a zero-based array and take the formula 2^index = value. 2^0 = 1, 2^1 = 2, 2^2 = 4 ... 2^32 = 4294967296 wait ... you only have 32 bits, that is index 0-31. To get max value you actually have to calculate the sum of 2^n with n from 0 to 31 or simpler 2^32 - 1 and you'll get '4294967295' as max for unsigned int, one less than anticipated. Now do the same with 2^31 - 1 for signed int and you'll get 2,147,483,647. Do that two times (one for negative and one for positive int) and there you'll get your discrepancy of 2 from 2*(2^31 - 1) to 2^32 ;) Feb 24, 2016 at 16:12
  • 20
    Simply use: Integer.MAX_VALUE in Java.
    – Tim
    Apr 5, 2016 at 13:31
  • 127
    2,147,483,647 = 0x7FFFFFFF, if you wanna remember it, just use hex. Aug 13, 2016 at 6:18
492
votes

The most correct answer I can think of is Int32.MaxValue.

9
  • 18
    Before this existed, I used to #define INT32_MIN and INT32_MAX in all my projects.
    – WildJoe
    Sep 12, 2011 at 19:04
  • 3
    When you are programming: yes in 99% of cases. But you may want to know that it's something like ~ 2 billion to planning programming approaches or when working with data, although it's a very large number. :) Nov 17, 2013 at 21:53
  • @sehe Isn't latin1/Windows 1252 obsolete by now? If it can't fit in the 7 bytes of ASCII, I don't think it deserves a place in main-memory. I mean... all UNICODE code-pages is kinda useful, but over a meg of skin-space seems a waste. (Not to mention it still doesn't include descriptive glyphs for "pageup/pagedown" or "pagehome/pageend")
    – user645280
    May 28, 2014 at 14:18
  • try that in python2. Actually don't; I will tell you that the built in int object does not have this. :(
    – dylnmc
    Nov 20, 2014 at 16:48
  • 1
    This property might be a good advice additionally to mentioning the correct number. However, I don't like this answer as it only mentions an unportable way of dertermining the value and it doesn't mention for which programming languages this is works, either...
    – mozzbozz
    Dec 12, 2014 at 12:29
439
votes

If you think the value is too hard to remember in base 10, try base 2: 1111111111111111111111111111111

11
  • 145
    @Nick Whaley: No, 1111111111111111111111111111111 is positive. 11111111111111111111111111111111 would be negative :-)
    – Curd
    Apr 19, 2011 at 12:48
  • 58
    Base 16 it's even easier 7FFFFFFF Apr 30, 2014 at 11:58
  • 34
    @Curd 11111111111111111111111111111111 as a base-2 number would still be positive (an example negative in base-2 would be -1). That sequence of bits is only negative if representing a 32-bit 2's complement number :) May 16, 2014 at 13:35
  • 143
    Easiest to remember will be base 2,147,483,647. Then all you have to remember is 1. Aug 18, 2014 at 8:58
  • 82
    @tim_barber_7BB actually, it's 10.
    – fscheidl
    Aug 18, 2014 at 17:44
315
votes

if you can remember the entire Pi number, then the number you are looking for is at the position 1,867,996,680 till 1,867,996,689 of the decimal digits of Pi

The numeric string 2147483647 appears at the 1,867,996,680 decimal digit of Pi. 3.14......86181221809936452346214748364710527835665425671614...

source: http://www.subidiom.com/pi/

11
  • 30
    you know, when i started reading your answer i was expecting something practical, like the 20th digit. Nov 16, 2015 at 9:55
  • 95
    This seems pretty cool. Do you have another memory rule to remember 1,867,996,680? I find it difficult to remember at which index to start looking....
    – Alderath
    Jan 13, 2016 at 8:35
  • 10
    "if you can remember the entire Pi number..." - no, you can't, it is irrational {as are possibly one or two posts in this Q&As} 8-D
    – SlySven
    Jun 24, 2016 at 21:45
  • 10
    @Alderath I typically remember it as the 10 decimals in sqrt(2) starting at digit number 380,630,713....
    – htd
    Sep 6, 2016 at 18:38
  • 2
    @Alderath: The numeric string 1867996680 appears at the 380,630,713rd decimal digit of the Square Root of 2. Dec 14, 2017 at 11:04
291
votes

It's 10 digits, so pretend it's a phone number (assuming you're in the US). 214-748-3647. I don't recommend calling it.

4
  • 13
    Speaking of remembering it as a phone number, it seems that there may be some phone spammers using it: mrnumber.com/1-214-748-3647
    – Steven
    Oct 22, 2010 at 14:57
  • 8
    "There is no "748" exchange in Dallas. This number is fake." - from the page linked by shambleh Jan 21, 2011 at 22:10
  • 104
    @Steven I don't think they're spammers, just people who accidentally stored the phone number as an INT instead of VARCHAR in MySQL.
    – Zarel
    Feb 9, 2011 at 2:00
  • 8
    Tried calling it. It rang a few times then went to the error dial tone. =(
    – Krythic
    Feb 21, 2016 at 3:52
172
votes

Rather than think of it as one big number, try breaking it down and looking for associated ideas eg:

  • 2 maximum snooker breaks (a maximum break is 147)
  • 4 years (48 months)
  • 3 years (36 months)
  • 4 years (48 months)

The above applies to the biggest negative number; positive is that minus one.

Maybe the above breakdown will be no more memorable for you (it's hardly exciting is it!), but hopefully you can come up with some ideas that are!

9
  • 99
    That is one of the most complicated mneumonic devices I have seen. Impressive. Sep 18, 2008 at 17:34
  • 9
    Heh, the likes of Derren Brown actually advocate this kind of approach - breaking a number down into something random but whieh is more memorable than just a load of numbers: channel4.com/entertainment/tv/microsites/M/mindcontrol/remember/… Sep 18, 2008 at 22:02
  • 19
    I have a better mnemonic: all you need to remember are 2 and 31, as it is apparently exactly 2^31 ! Oh, wait... Jun 17, 2009 at 10:08
  • 28
    @DrJokepu I am not sure about the operator precedence... Does that mean 2^(31!) or (2^31)!?
    – Alderath
    Mar 29, 2012 at 10:27
  • 1
    @Lucio Note that my answer relates in the first instance to the biggest negative number which ends in 48, not 47 May 21, 2013 at 8:49
144
votes

Largest negative (32bit) value : -2147483648
(1 << 31)

Largest positive (32bit) value : 2147483647
~(1 << 31)

Mnemonic: "drunk AKA horny"

drunk ========= Drinking age is 21
AK ============ AK 47
A ============= 4 (A and 4 look the same)
horny ========= internet rule 34 (if it exists, there's 18+ material of it) 

21 47 4(years) 3(years) 4(years)
21 47 48       36       48
7
  • 27
    The worlds most difficult to recall Mnemonic. If you can memorise 0118 999 88199 9119 752...3 you can memorise this.
    – BenM
    Jan 20, 2014 at 13:33
  • 11
    @Rondles I think it's actually 7253 at the end. Jan 24, 2014 at 18:17
  • 21
    Nope. Drinking age is 18 here... Seems like I can't use this mnemonic, my life is ruined.
    – Joffrey
    Jun 19, 2014 at 18:17
  • 4
    @Aaren Cordova They used to say stackoverflow will never be funny, be nothing more than a Q&A site, I generally point them to this answer. This thing can only be created inside a genius mind, I mean this is Art. Jun 29, 2015 at 21:16
  • 5
    The largest negative 32 bit integer, or 64 bit for that matter, is -1. Jun 21, 2016 at 21:04
75
votes

Anyway, take this regex (it determines if the string contains a non-negative Integer in decimal form that is also not greater than Int32.MaxValue)

[0-9]{1,9}|[0-1][0-9]{1,8}|20[0-9]{1,8}|21[0-3][0-9]{1,7}|214[0-6][0-9]{1,7}|2147[0-3][0-9]{1,6}|21474[0-7][0-9]{1,5}|214748[0-2][0-9]{1,4}|2147483[0-5][0-9]{1,3}|21474836[0-3][0-9]{1,2}|214748364[0-7]

Maybe it would help you to remember.

1
  • 12
    That sounds a lot easier and fun to me. Actually it really is much easier than 2147483647. This would be of great help for the OP Mar 24, 2015 at 17:45
61
votes

That's how I remembered 2147483647:

  • 214 - because 2.14 is approximately pi-1
  • 48 = 6*8
  • 64 = 8*8

Write these horizontally:

214_48_64_
and insert:
   ^  ^  ^
   7  3  7 - which is Boeing's airliner jet (thanks, sgorozco)

Now you've got 2147483647.

Hope this helps at least a bit.

4
  • 3
    Nice one! I think the 214 rule should be pi - 1. Also the mask shows 68 rather than 64. =) For aviation buffs like me, the 737 value should be easy to remember associating it with Boeing's medium-sized airliner jet.
    – user1222021
    Sep 19, 2013 at 19:51
  • You can go further than that. Drop the decimal and compare pi and 2^31-1. In the same positions you get 141 vs 147, so the last digit just becomes a 7. Then 592 vs 483, all are one digit off of each other. And 643 vs 647, it's that becoming a 7 thing again. Oct 10, 2013 at 10:45
  • @PeterCooper Altho the decimals for pi starts with 1415926_5_35 (Note the 5, not a 4)
    – Moberg
    Feb 17, 2014 at 22:27
  • 15
    My mnemonic is to take 4294967296 (which is easy to remember) and divide by 2
    – M.M
    Sep 5, 2014 at 5:39
55
votes
2^(x+y) = 2^x * 2^y

2^10 ~ 1,000
2^20 ~ 1,000,000
2^30 ~ 1,000,000,000
2^40 ~ 1,000,000,000,000
(etc.)

2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5 = 32
2^6 = 64
2^7 = 128
2^8 = 256
2^9 = 512

So, 2^31 (signed int max) is 2^30 (about 1 billion) times 2^1 (2), or about 2 billion. And 2^32 is 2^30 * 2^2 or about 4 billion. This method of approximation is accurate enough even out to around 2^64 (where the error grows to about 15%).

If you need an exact answer then you should pull up a calculator.

Handy word-aligned capacity approximations:

  • 2^16 ~= 64 thousand // uint16
  • 2^32 ~= 4 billion // uint32, IPv4, unixtime
  • 2^64 ~= 16 quintillion (aka 16 billion billions or 16 million trillions) // uint64, "bigint"
  • 2^128 ~= 256 quintillion quintillion (aka 256 trillion trillion trillions) // IPv6, GUID
1
  • 76
    That's what the hard-drive makers said. Oct 29, 2010 at 20:27
46
votes

Just take any decent calculator and type in "7FFFFFFF" in hex mode, then switch to decimal.

2147483647.

6
  • 150
    Any decent calculator can do 2^31 as well. Jun 17, 2009 at 12:01
  • 17
    I don't know 2^31 seems like the long way to do it :/
    – States
    Oct 26, 2012 at 2:27
  • 2
    Or just remember it in hex
    – Vernon
    Jan 30, 2013 at 18:44
  • 4
    Just... write it in hex. Or Int32.MaxValue/numeric_limits<int32_t>::max()
    – sehe
    Feb 12, 2013 at 9:50
  • 8
    @Christoffer It is actually 2^31 - 1 :)
    – kupsef
    Aug 25, 2014 at 13:09
36
votes

It's about 2.1 * 10^9. No need to know the exact 2^{31} - 1 = 2,147,483,647.

C

You can find it in C like that:

#include <stdio.h>
#include <limits.h>

main() {
    printf("max int:\t\t%i\n", INT_MAX);
    printf("max unsigned int:\t%u\n", UINT_MAX);
}

gives (well, without the ,)

max int:          2,147,483,647
max unsigned int: 4,294,967,295

C++ 11

std::cout << std::numeric_limits<int>::max() << "\n";
std::cout << std::numeric_limits<unsigned int>::max() << "\n";

Java

You can get this with Java, too:

System.out.println(Integer.MAX_VALUE);

But keep in mind that Java integers are always signed.

Python 2

Python has arbitrary precision integers. But in Python 2, they are mapped to C integers. So you can do this:

import sys
sys.maxint
>>> 2147483647
sys.maxint + 1
>>> 2147483648L

So Python switches to long when the integer gets bigger than 2^31 -1

2
  • The Python answer is outdated see: stackoverflow.com/questions/13795758/…
    – NOhs
    Jun 10, 2018 at 15:14
  • @NOhs I appreciate the link, but my Python answer is about "Python 2" (I add the 2 to the section title to make it more clear). So my answer is not outdated. (But Python 2, admittedly, is) Jun 10, 2018 at 16:03
35
votes

Here's a mnemonic for remembering 2**31, subtract one to get the maximum integer value.

a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9

Boys And Dogs Go Duck Hunting, Come Friday Ducks Hide
2    1   4    7  4    8        3    6      4     8

I've used the powers of two up to 18 often enough to remember them, but even I haven't bothered memorizing 2**31. It's too easy to calculate as needed or use a constant, or estimate as 2G.

2
  • 3
    What do you do for 2^10, 2^11, 2^12, or 2^17 (all of which have zeroes)?
    – supercat
    May 10, 2013 at 23:47
  • 2
    @supercat I'd either rebase a=0, or use o=0. May 11, 2013 at 0:33
31
votes

32 bits, one for the sign, 31 bits of information:

2^31 - 1 = 2147483647

Why -1?
Because the first is zero, so the greatest is the count minus one.

EDIT for cantfindaname88

The count is 2^31 but the greatest can't be 2147483648 (2^31) because we count from 0, not 1.

Rank   1 2 3 4 5 6 ... 2147483648
Number 0 1 2 3 4 5 ... 2147483647

Another explanation with only 3 bits : 1 for the sign, 2 for the information

2^2 - 1 = 3

Below all the possible values with 3 bits: (2^3 = 8 values)

1: 100 ==> -4
2: 101 ==> -3
3: 110 ==> -2
4: 111 ==> -1
5: 000 ==>  0
6: 001 ==>  1
7: 010 ==>  2
8: 011 ==>  3
1
  • @cantfindaname88: 2^31 = total combinations, so it ranges from 0 to (2^31 -1). Yes the first is 0.
    – Luciano
    Aug 12, 2015 at 12:37
30
votes

Well, it has 32 bits and hence can store 2^32 different values. Half of those are negative.

The solution is 2,147,483,647

And the lowest is −2,147,483,648.

(Notice that there is one more negative value.)

1
  • It has 32 bits and hence can store 2^32 values. No less.
    – JB.
    Sep 18, 2008 at 17:29
28
votes

Well, aside from jokes, if you're really looking for a useful memory rule, there is one that I always use for remembering big numbers.

You need to break down your number into parts from 3-4 digits and remember them visually using projection on your cell phone keyboard. It's easier to show on a picture:

enter image description here

As you can see, from now on you just have to remember 3 shapes, 2 of them looks like a Tetris L and one looks like a tick. Which is definitely much easier than memorizing a 10-digit number.

When you need to recall the number just recall the shapes, imagine/look on a phone keyboard and project the shapes on it. Perhaps initially you'll have to look at the keyboard but after just a bit of practice, you'll remember that numbers are going from top-left to bottom-right so you will be able to simply imagine it in your head.

Just make sure you remember the direction of shapes and the number of digits in each shape (for instance, in 2147483647 example we have a 4-digit Tetris L and a 3-digit L).

You can use this technique to easily remember any important numbers (for instance, I remembered my 16-digit credit card number etc.).

5
  • Neat idea! Shape 1 gives you 2147, Shape 2 gives you 483, and Shape 3 is supposed to give 647, but as drawn, it could be interpreted as 6547. How do I know when to include all the crossed numbers (as in Shape 1) vs. when to skip some (as in Shape 3)? You also have to memorize that the shapes encode 4, 3, and 3 digits, respectively. Or you could draw Shape 3 with an arc from 6 to 4 instead of a straight line.
    – jskroch
    Oct 19, 2017 at 16:17
  • @Squinch Well, particularly for remembering int.Max it shouldn't be a problem as you might know that it's about 2 billion so it has 10 numbers in it (and that means if the first shape has 4 numbers then the second and the third shapes have 3 accordingly). However, that's a nice point if you want to use this approach for any number. Also, there are numbers that are difficult to remember using this way (i.e. 1112 or something). On the other hand, it shouldn't be difficult to remember such number anyway. So I'd say it's up to you, let me know if you come up with something interesting for this. :) Oct 19, 2017 at 16:30
  • Yes, I was thinking about using this method to recall an arbitrary sequence of digits, but for this particular int.Max value, your method works fairly well. As you said, repeated digits are a problem. In fact, any repeated sequence (such as 2323) is a problem. Any sequence that crosses itself (such as 2058) is difficult to draw. Any memorization technique requires you to remember several pieces of information. It's personal preference what types of info best stick in your head.
    – jskroch
    Oct 19, 2017 at 19:35
  • 1
    This is how I remember pin codes and similar, but then all of a sudden you need to type it in on your computer and realize that the numpad is vertically flipped. So that's a bit of a challenge.
    – nibarius
    May 22, 2018 at 8:47
  • Somebody in Dallas, Texas, has received many strange phone calls and has no idea that you @IvanYurchenko are to blame.
    – Bob Stein
    Jun 6, 2019 at 16:54
21
votes

The easiest way to do this for integers is to use hexadecimal, provided that there isn't something like Int.maxInt(). The reason is this:

Max unsigned values

8-bit 0xFF
16-bit 0xFFFF
32-bit 0xFFFFFFFF
64-bit 0xFFFFFFFFFFFFFFFF
128-bit 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Signed values, using 7F as the max signed value

8-bit 0x7F
16-bit 0x7FFF
32-bit 0x7FFFFFFF
64-bit 0x7FFFFFFFFFFFFFFF

Signed values, using 80 as the max signed value

8-bit 0x80
16-bit 0x8000
32-bit 0x80000000
64-bit 0x8000000000000000

How does this work? This is very similar to the binary tactic, and each hex digit is exactly 4 bits. Also, a lot of compilers support hex a lot better than they support binary.

F hex to binary: 1111
8 hex to binary: 1000
7 hex to binary: 0111
0 hex to binary: 0000

So 7F is equal to 01111111 / 7FFF is equal to 0111111111111111. Also, if you are using this for "insanely-high constant", 7F... is safe hex, but it's easy enough to try out 7F and 80 and just print them to your screen to see which one it is.

0x7FFF + 0x0001 = 0x8000, so your loss is only one number, so using 0x7F... usually isn't a bad tradeoff for more reliable code, especially once you start using 32-bits or more

21
votes

First write out 47 twice, (you like Agent 47, right?), keeping spaces as shown (each dash is a slot for a single digit. First 2 slots, then 4)

--47----47

Think you have 12 in hand (because 12 = a dozen). Multiply it by 4, first digit of Agent 47's number, i.e. 47, and place the result to the right of first pair you already have

12 * 4 = 48
--4748--47 <-- after placing 48 to the right of first 47

Then multiply 12 by 3 (in order to make second digit of Agent 47's number, which is 7, you need 7 - 4 = 3) and put the result to the right of the first 2 pairs, the last pair-slot

12 * 3 = 36
--47483647 <-- after placing 36 to the right of first two pairs

Finally drag digits one by one from your hand starting from right-most digit (2 in this case) and place them in the first empty slot you get

2-47483647 <-- after placing 2
2147483647 <-- after placing 1

There you have it! For negative limit, you can think of that as 1 more in absolute value than the positive limit.

Practise a few times, and you will get the hang of it!

0
20
votes

2GB

(is there a minimum length for answers?)

6
  • 9
    @JoukevanderMaas - Actually, it should be 4B.
    – Ted Hopp
    Sep 14, 2012 at 16:09
  • 1
    Which is why the limit of RAM you can have on a 32bit computer is 4GB
    – Serj Sagan
    May 11, 2013 at 0:37
  • 3
    the value of 4GB is correct with unsigned integers. if you have a signed int, you obviously need to divide by 2 to get the max value possible
    – SwissCoder
    May 27, 2013 at 4:53
  • @SerjSagan It's 3GB in Windows 32-bit AFAIK. Not sure why!
    – atoMerz
    Aug 22, 2013 at 6:35
  • 3
    In 32-bit there is 2GB of the memory-space reserve for user process, and 2GB for kernel. It can be configured so kernel have only 1 GB reserved
    – Rune
    Aug 27, 2013 at 14:41
15
votes

Assuming .NET -

Console.WriteLine(Int32.MaxValue);
15
votes

If you happen to know your ASCII table off by heart and not MaxInt :
!GH6G = 21 47 48 36 47

1
  • When I wrote this answer I didn't know GH6G had so many Google hits, and now I've used this myself :-)
    – Mark Hurd
    Feb 4, 2016 at 1:36
15
votes

The best rule to memorize it is:
21 (magic number!)
47 (just remember it)
48 (sequential!)
36 (21 + 15, both magics!)
47 again

Also it is easier to remember 5 pairs than 10 digits.

14
votes

The easiest way to remember is to look at std::numeric_limits< int >::max()

For example (from MSDN),

// numeric_limits_max.cpp

#include <iostream>
#include <limits>

using namespace std;

int main() {
   cout << "The maximum value for type float is:  "
        << numeric_limits<float>::max( )
        << endl;
   cout << "The maximum value for type double is:  "
        << numeric_limits<double>::max( )
        << endl;
   cout << "The maximum value for type int is:  "
        << numeric_limits<int>::max( )
        << endl;
   cout << "The maximum value for type short int is:  "
        << numeric_limits<short int>::max( )
        << endl;
}
14
votes

Interestingly, Int32.MaxValue has more characters than 2,147,483,647.

But then again, we do have code completion,

So I guess all we really have to memorize is Int3<period>M<enter>, which is only 6 characters to type in visual studio.

UPDATE For some reason I was downvoted. The only reason I can think of is that they didn't understand my first statement.

"Int32.MaxValue" takes at most 14 characters to type. 2,147,486,647 takes either 10 or 13 characters to type depending on if you put the commas in or not.

3
  • 2
    But what counts is not how many characters you have to type, but how to memoize it. I'm sure Iwannagohome is easier to memoize than 298347829. No reason for a -1, however.
    – glglgl
    Nov 25, 2013 at 17:47
  • 3
    It could be less than that, just make your own max value snippet, "imv" <tab> <tab> perhaps? Jan 22, 2014 at 21:30
  • 4
    Characters != Keystrokes. For this poor .Net user, it's in+.+ma+Return. Mar 13, 2014 at 19:40
10
votes

Just remember that 2^(10*x) is approximately 10^(3*x) - you're probably already used to this with kilobytes/kibibytes etc. That is:

2^10 = 1024                ~= one thousand
2^20 = 1024^2 = 1048576    ~= one million
2^30 = 1024^3 = 1073741824 ~= one billion

Since an int uses 31 bits (+ ~1 bit for the sign), just double 2^30 to get approximately 2 billion. For an unsigned int using 32 bits, double again for 4 billion. The error factor gets higher the larger you go of course, but you don't need the exact value memorised (If you need it, you should be using a pre-defined constant for it anyway). The approximate value is good enough for noticing when something might be a dangerously close to overflowing.

2
  • 10
    Offtopic: 2^4 = 4^2, therefore exponentiation is commutative!
    – Adam Liss
    Nov 5, 2008 at 1:17
  • 10
    @Pier-OlivierThibault nope, I use it all the time! now I need to find out why all my math is coming out wrong. probably something to do with multiplication errors. anyway, bye!
    – tckmn
    May 11, 2013 at 21:31
9
votes

this is how i do it to remember 2,147,483,647

To a far savannah quarter optimus trio hexed forty septenary

2 - To
1 - A
4 - Far
7 - Savannah
4 - Quarter
8 - Optimus
3 - Trio
6 - Hexed
4 - Forty
7 - Septenary
0
7
votes

What do you mean? It should be easy enough to remember that it is 2^32. If you want a rule to memorize the value of that number, a handy rule of thumb is for converting between binary and decimal in general:

2^10 ~ 1000

which means 2^20 ~ 1,000,000

and 2^30 ~ 1,000,000,000

Double that (2^31) is rounghly 2 billion, and doubling that again (2^32) is 4 billion.

It's an easy way to get a rough estimate of any binary number. 10 zeroes in binary becomes 3 zeroes in decimal.

1
  • 7
    but it's not 2^32 - it's (2^31)-1 Mar 3, 2009 at 11:26
6
votes

In Objective-C (iOS & OSX), just remember these macros:

#define INT8_MAX         127
#define INT16_MAX        32767
#define INT32_MAX        2147483647
#define INT64_MAX        9223372036854775807LL

#define UINT8_MAX         255
#define UINT16_MAX        65535
#define UINT32_MAX        4294967295U
#define UINT64_MAX        18446744073709551615ULL
0
5
votes

Int32 means you have 32 bits available to store your number. The highest bit is the sign-bit, this indicates if the number is positive or negative. So you have 2^31 bits for positive and negative numbers.

With zero being a positive number you get the logical range of (mentioned before)

+2147483647 to -2147483648

If you think that is to small, use Int64:

+9223372036854775807 to -9223372036854775808

And why the hell you want to remember this number? To use in your code? You should always use Int32.MaxValue or Int32.MinValue in your code since these are static values (within the .net core) and thus faster in use than creating a new int with code.

My statement: if know this number by memory.. you're just showing off!

1
  • 2
    Most modern computers store numbers in "twos compliment" format. The highest (not lowest) bit is the sign. The neat thing with twos compement is that -ve numbers are handled by the natural overflow rules of the CPU. i.e 0xFF is 8 bit -1, add that to 0x01 (+1) and you get 0x100. Truncate bits above 8 to 0x00 and you have your answer.
    – Tom Leys
    Jun 17, 2009 at 9:27
5
votes

Remember this: 21 IQ ITEM 47

It can be de-encoded with any phone pad, or you can just write one down yourself on a paper.

In order to remember "21 IQ ITEM 47", I would go with "Hitman:Codename 47 had 21 missions, which were each IQ ITEM's by themselves".

Or "I clean teeth at 21:47 every day, because I have high IQ and don't like items in my mouth".

1
  • What do you mean with de-encoded with any phone pad?
    – mcExchange
    Oct 28, 2017 at 7:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.