Important numbers to remember as a computer professional

From SusoSight

When you work with computers a lot, you end up working with a lot of numbers. Often times, to solve or diagnose problems, knowing certain numbers by heart will help you. Here is a list of numbers that I often use in my daily work activities.

Note: This is a work in progress of course. Comments are welcome.

Powers of 2

  • Powers of 2 - 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc.
  • The ones that probably come up often are 16, 32, 64, 128, 256, 512, 1024, 4096#1, 65535 (216), 16777216 (224), 2147483648 (231), 4294967296 (232), 18446744073709551616#2 (264)
  • 1 off numbers. When you see a number like 255, you'll know that its 256, but zero based. Or 65535 is 216 - 1

Hexadecimal

  • Hexadecimal, which is base 16 is usually expressed as 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Often you'll see expressions like <A8>, which actually is 169 in decimal.

ASCII/ANSI characters

Values of various ASCII characters that you may see in the output of programs or used in URLs, etc. I should make a table format for these instead of a list.

Hex

  • 00 - NULL
  • 0D - Carriage return
  • 20 - Space

Decimal

  • 0 - NULL
  • 13 - Carriage return
  • 32 - Space


Time

You'll see a lot of these in DNS TTL records, cron stuff and sleep values.

  • 86400 - Number of seconds in a day
  • 604800 - Number of seconds in a week
  • 3600 - Number of seconds in an hour
  • 7200, 10800, 14400 - The first few multiples of 3600.
  • 600, 900, 1800 - Number of seconds in 10 minutes, 15 minutes and 30 minutes
  • 1970 - The year that Unix epoch time started. Specially, January 1st.


Turning G into Gi

You often see data values expressed in base 2 instead of base 10. For instance a Kilobyte is actually 1024 bytes, not 1000 bytes. If you ever want to convert some value to the base 2 values, you can just use this formula for some value N to get the result R

  • Kibibytes = N/(210)
  • Mebibytes = N/(220)
  • Gibibytes = N/(230)
  • Tebibytes = N/(240)
  • Pebibytes = N/(250)
  • Exbibytes = N/(260)

To convert the base2 number back to base10 you just reverse the formula and solve for N.

  • bytes = Kibibytes*210
  • bytes = Mebibytes*220
  • bytes = Gibibytes*230
  • bytes = Tebibytes*240
  • bytes = Pebibytes*250
  • bytes = Exbibytes*260

Or if you already have a base10 quantified number like 10.5 Megabytes and want to express it in Mebibytes, you do this:

Mebibytes = Megabytes * 106/(220)

The 106 part comes from the fact that 1,000,000 is 10 to the 6th power. A billion or a Gigabyte (base10) is 109 and so on.

This is why that 2 TB drive that you just bought is actually 1.8189 TiB.

Footnotes

[#1] - One day in a college level calculus I blew everyone away when I knew that log2 of 4096 was 12 within a second or two without using a calculator. I simply knew that 212 was 4096 and I mostly remembered it from having an Amiga, which had 12 bit color in HAM mode. Yeah, I'm a geek. I got an applause from the class though and that felt pretty good.
[#2] - 18446744073709551616? What you can't be serious. No, I don't expect you to remember that whole number, but usually you'll just recognize it by it starting with 1844 and then a long string of digits and you'll know that its probably something to do with 64-bit boundaries.