Numbers

Last updated: January 8, 2026

Numbers are the basic objects used to count, measure, quantify and calculate things.

Sets of numbers

There are multiple sets of numbers:

  • Natural numbers: N={0,1,2,3,4,...}N = \{0, 1, 2, 3, 4, ...\}
  • Integers: Z={...,5,4,3,2,1,0}NZ = \{..., -5, -4, -3, -2, -1, 0\} \cup N
  • Rational: Q={53,1.5,...}ZQ = \{\frac{5}{3}, 1.5, ...\} \cup Z
  • Real: R={π,2,e,...}QR = \{\pi,\sqrt{2},e, ...\} \cup Q
  • Complex: C={1+i,2+3i,...}RC=\{1 + i, 2 + 3i, ...\} \cup R , where π\pi, ee and ii are constants.

Natural numbers

Numbers from 11 to \infty with step of 1.

Integers

Numbers from -\infty to 0 with step of 1 and all natural numbers.

Rational numbers

Numbers that are fractions in form of mn\frac{m}{n}, where n0n \neq 0 and all integers.

Real numbers

Numbers with infinitely long decimal expansion that does not repeat and all rational numbers. Example is π\pi which is 3.1415926...3.1415926... and never repeats.

Complex numbers

All real numbers and numbers that have two parts - real part plus real constant multiplied by ii. Example is π+ei\pi + ei or 3+2i3 + 2i.

Number operations

There are a couple of operations we can do with numbers:

  • Addition (++) and inverse operation Subtraction (-);
  • Multiplication (*) and inverse operation Division (//);
  • Exponentiation (xax^a) and inverse operations Logarithm (logablog_ab) and Roots (ba\sqrt[a]{b}).

Number representations

There are a few ways to represent a number:

  • Decimal (Denary) an...a4a3a2a1a0.a1a2...ama_n...a_4a_3a_2a_1a_0.a_{-1}a_{-2}...a_{-m}, where ai{0,1,2,3,...,9}a_i \in \{0, 1, 2, 3, ..., 9\} and each aia_i represents a×10ia \times 10^i, for example 123.456123.456;
  • Binary an...a4a3a2a1a0.a1a2...ama_n...a_4a_3a_2a_1a_0.a_{-1}a_{-2}...a_{-m}, where ai{0,1}a_i \in \{0, 1\} and each aia_i represents a×2ia \times 2^i, for example 100101.110001100101.110001;
  • Fraction mn\frac{m}{n}, where mRm \in R, nRn \in R and n0n \neq 0, for example 5623\frac{56}{23};
  • Scientific a0.a1a2...am×baseba_0.a_{-1}a_{-2}...a_{-m} \times base^b, where ai{0,...,base1}a_i \in \{0, ..., base-1\}, bRb \in R and each aia_i represents a×baseia \times base^i, for example 1.2345×1041.2345 \times 10^4.