Number types

Choose a type of number, then type an expression involving that number.

Number type:

Modulus:

Modulus:

p =

Input:

Result:

General info

This program is a calculator that supports various different number systems besides the real numbers. For instance, it supports:

• Various number systems that have extra non-real numbers, including the complex numbers and various other systems that work similarly
• Various number systems that have some notion of infinity

Supported operations

Not all operations are supported by all number systems (either due to the operation not making sense in that system, or due to me not having programmed it in yet). Some number systems may support additional operations.

OperationStandard notationType as
Additionx + y`x + y`
Subtractionx - y`x - y`
Multiplicationxy or x×y or x·y`x * y` or `xy`
Divisionx/y, x ÷ y`x / y`
Exponents/powersxy`x ^ y`
Exponentsex, exp x`exp x`
Natural logarithmsln x`ln x`
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Absolute value|x|`|x|` or `abs x`
Conjugate or x*`conj x`

Info: Natural numbers (ℕ)

Ordinary counting numbers (1, 2, 3); may or may not include 0, depending on the specific definition. Does not include negative numbers, fractions, any sort of infinity, or imaginary numbers.

Cardinality: ℵ0; structure: commutative monoid with both + and · (or a semigroup with + if 0 is not included); subset of: ℤ, ℚ, ℝ, ℂ

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`closed, associative, commutative, has identity (0), no inverses
Subtractionx - y`x - y`partial, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y`closed, associative, commutative, distributive over + and -, has identity (1), possibly has absorbing element (0), no inverses
Divisionx/y, x ÷ y`x / y`partial (can't divide by 0, only some pairs of numbers are divisible), nonassociative, noncommutative, right-distributive over + and -, has right identity (1), possibly has left absorbing element (0)
Exponents/powersxy`x ^ y`partial (y must be non-negative), nonassociative, noncommutative, distributive over × and ÷, has right identity (1), has left absorbing element (0)
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`partial (not defined for x < 0, doesn't always give an integer), monotonically increasing, two fixed points (0, 1), one-to-one
GCDgcd(x, y) or (x, y)`gcd(x, y)` or `(x, y)`closed, associative, commutative, has identity (0), has absorbing element (1), distributive over LCM
LCMlcm(x, y) or [x, y]`lcm(x, y)` or `[x, y]`closed, associative, commutative, has identity (1), has absorbing element (0), distributive over GCD

Info: Integers (ℤ)

Ordinary counting numbers (1, 2, 3) plus the negative numbers (-1, -2, -3) and zero. Does not include fractions, any sort of infinity, or imaginary numbers.

Cardinality: ℵ0; structure: integral domain; superset of: ℕ; subset of: ℚ, ℝ, ℂ

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y`closed, associative, commutative, distributive over + and -, has identity (1), has absorbing element (0), no inverses
Divisionx/y, x ÷ y`x / y`partial (can't divide by 0, only some pairs of numbers are divisible), nonassociative, noncommutative, right-distributive over + and -, has right identity (1), has left absorbing element (0)
Exponents/powersxy`x ^ y`partial (y must be non-negative), nonassociative, noncommutative, distributive over × and ÷, has right identity (1)
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`partial (not defined for x < 0, doesn't always give an integer), monotonically increasing, two fixed points (0, 1), one-to-one
GCDgcd(x, y) or (x, y)`gcd(x, y)` or `(x, y)`closed, associative, commutative, has identity (0), has absorbing element (1), distributive over LCM
LCMlcm(x, y) or [x, y]`lcm(x, y)` or `[x, y]`closed, associative, commutative, has identity (1), has absorbing element (0), distributive over GCD
Absolute value|x|`|x|` or `abs x`total, has fixed points (all non-negative numbers), even

Info: Real numbers (ℝ)

The ordinary numbers we usually deal with. Includes irrational numbers (though this program can't represent irrational numbers exactly). Does not include any sort of infinity, or imaginary numbers.

Cardinality: ℶ1; structure: field; superset of: ℕ, ℤ, ℚ; subset of: ℂ

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y`closed, associative, commutative, distributive over + and -, has identity (1), has absorbing element (0), has inverses (1/x)
Divisionx/y, x ÷ y`x / y`partial (can't divide by 0), nonassociative, noncommutative, right-distributive over + and -, has right identity (1), has left absorbing element (0)
Exponents/powersxy`x ^ y`partial (e.g. -11/2 is undefined), nonassociative, noncommutative, distributive over × and ÷, has right identity (1)
Exponentsex, exp x`exp x`total, monotonically increasing, no fixed points, one-to-one
Natural logarithmsln x`ln x`partial (not defined for x ≤ 0), monotonically increasing, no fixed points, bijection (from domain where it's defined to ℝ)
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`partial (not defined for x < 0), monotonically increasing, two fixed points (0, 1), one-to-one

Info: Complex numbers (ℂ)

Includes all real numbers, and an imaginary unit i (sometimes written j instead) that's the square root of -1. Any complex number can be written as a + bi, where a and b are real numbers. Most operations behave similarly to the real numbers, with the notable exception that xyx·√y.

Cardinality: ℶ1; structure: field; superset of: ℕ, ℤ, ℚ, ℝ

Supported operations

OperationStandard notationType asProperties
Imaginary uniti`i`
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y` or `xy`closed, associative, commutative, distributive over + and -, has identity (1), has inverses (1/x)
Divisionx/y, x ÷ y`x / y`partial (can't divide by 0), nonassociative, noncommutative, right-distributive over + and -, has right identity (1)
Exponents/powersxy`x ^ y`nonassociative, noncommutative, has right identity (1)
Exponentsex, exp x`exp x`total
Natural logarithmsln x`ln x`
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Absolute value|x|`|x|` or `abs x`total, has fixed points (all non-negative real numbers)
Conjugate or x*`conj x`total, has fixed points (all real numbers), bijection

Info: Split-complex numbers

Split-complex numbers are like complex numbers, except instead of i there's j, which if you square it gives 1 rather than -1.

Cardinality: ℶ1; structure: commutative ring; superset of: ℕ, ℤ, ℚ, ℝ

Supported operations

OperationStandard notationType asProperties
Imaginary unitj`j`
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y` or `xy`closed, associative, commutative, distributive over + and -, has identity (1)
Divisionx/y, x ÷ y`x / y`partial (can't divide by numbers of the form a ± aj), nonassociative, noncommutative, right-distributive over + and -, has right identity (1)
Exponents/powersxy`x ^ y`nonassociative, noncommutative, has right identity (1)
Exponentsex, exp x`exp x`
Natural logarithmsln x`ln x`
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Absolute value|x|`|x|` or `abs x`total, has fixed points (all non-negative real numbers)
Conjugate or x*`conj x`total, has fixed points (all real numbers), bijection

(I'm not sure if I got the power stuff right.)

Info: Dual numbers

Dual numbers are like complex numbers, except instead of i you have ε (epsilon; type this as `ep`), and instead of ε2 being -1, it's 0.

This makes them kind of sort of like infinitesimals. Also, if you put in x + ε to a smooth function, then you get back both the result of the function at x (as the real part) and the derivative of the function at x (as the imaginary part).

Cardinality: ℶ1; structure: commutative ring; superset of: ℕ, ℤ, ℚ, ℝ

Supported operations

OperationStandard notationType asProperties
Imaginary unitε`epsilon` or `ep`
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y` or `xy`closed, associative, commutative, distributive over + and -, has identity (1)
Divisionx/y, x ÷ y`x / y`partial (can't divide by numbers whose real part is 0), nonassociative, noncommutative, right-distributive over + and -, has right identity (1)
Exponents/powersxy`x ^ y`nonassociative, noncommutative, has right identity (1)
Exponentsex, exp x`exp x`total
Natural logarithmsln x`ln x`
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Conjugate or x*`conj x`total, has fixed points (all real numbers), bijection

Info: Quaternions (ℍ)

Similar to the complex numbers, except that there are three imaginary units, i, j, and k, all of which square to -1. Any quaternion can be written as a + bi + cj + dk, where a, b, c, and d are real numbers. Unlike complex numbers, multiplication is not commutative.

Cardinality: ℶ1; structure: non-commutative ring; superset of: ℕ, ℤ, ℚ, ℝ, ℂ

Supported operations

OperationStandard notationType asProperties
Imaginary unitsi, j, k`i`, `j`, `k`
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y` or `xy`closed, associative, noncommutative, has identity (1), has inverses (x-1)
Exponentsex, exp x`exp x`total
Natural logarithmsln x`ln x`
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Conjugate or x*`conj x`total, has fixed points (all real numbers), bijection

This program does not yet support powers or division of quaternions

Info: Extended Real Number Line

The extended real number line includes all real numbers, and two infinite numbers, -∞ and +∞. Unlike some other types of numbers, it does not include multiple sizes of infinity. The result of operations on infinite numbers generally depends on limits (like in calculus). Dividing by zero in the extended real numbers is still undefined; it is not infinity.

Cardinality: ℶ1; superset of: ℕ, ℤ, ℚ, ℝ

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`partial (∞ + -∞ undefined), associative, commutative, has identity (0), has inverses for finite numbers (-x)
Subtractionx - y`x - y`partial, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·y`x * y`partial (∞·0 is undefined), associative, commutative, has identity (1), has inverses for finite nonzero numbers (1/x)
Divisionx/y, x ÷ y`x / y`partial (can't divide by 0, ∞/∞ is undefined), nonassociative, noncommutative, has right identity (1)
Exponents/powersxy`x ^ y`nonassociative, noncommutative, has right identity (1)
Exponentsex, exp x`exp x`total, fixed point (∞)
Natural logarithmsln x`ln x`partial (not defined for x < 0), fixed point (∞)
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Absolute value|x|`|x|` or `abs x`total, has fixed points (all non-negative numbers)

Exponentiation info from Wikipedia: Exponentiation: Limits of powers and Wolfram MathWorld

Info: Projectively Extended Real Line

The extended real number line includes all real numbers, and one infinity (∞). Not only does it not include multiple sizes of infinity, but it doesn't differentiate between positive and negative infinity; the number line can be thought of as a circle, with a single point at infinity, and positive numbers on one side of it, and negative numbers on the other side. Like the extended real number line, the result of operations on infinite numbers generally depends on limits (like in calculus). Unlike the extended real number line, dividing by zero is actually defined as infinity, except 0÷0, which is undefined.

Cardinality: ℶ1; superset of: ℕ, ℤ, ℚ, ℝ

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`Associative, commutative, has identity (0), has inverses for finite numbers (-x), partial (∞ + ∞ undefined)
Subtractionx - y`x - y`Nonassociative, noncommutative, has right identity (0), partial
Multiplicationxy or x×y or x·y`x * y`Associative, commutative, has identity (1), has inverses for finite nonzero numbers (1/x), partial (∞·0 is undefined)
Divisionx/y, x ÷ y`x / y`Nonassociative, noncommutative, has right identity (1), partial (0/0 and ∞/∞ are undefined)

Info: IEEE 754 floating point numbers

IEEE 754 is a standard for how computers can represent real numbers that aren't integers. Two main differences from real numbers:

• Since there are a limited number of bits in the number, there is a limit to the precision of the number and to the range. Floating point uses a binary version of scientific notation, with a set number of bits in the exponent and in the number multiplied by the exponent (11 and 52, respectively, for IEEE 64-bit floating point), which means that the precision depends on how big the number is. This means that addition and multiplication are not associative; for instance, (-123456789+123456789)+0.000000001 = 0.000000001 as expected, but -123456789+(123456789+0.000000001) = 0, because 123456789.000000001 is rounded to 123456789.
• There are three numbers that don't represent real numbers: positive and negative infinity, which act sort of like in the extended real number line; and NaN (which stands for "not a number"), which represents the result of operations that are undefined (like asin(2) or 0/0). Infinity is also used as the result of operations that produce numbers too high to represent (such as 10309). Division by zero can also result in infinity, unlike the extended real numbers; in particular, positive numbers divided by 0 result in positive infinity, negative numbers divided by zero result in negative infinity, and 0 divided by 0 results in NaN.

There are also positive and negative zero.

Cardinality: 18437736874454810627 (= 264 - 253 + 3)

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`Nonassociative, commutative, has identity (-0; for numbers other than -0, 0 is also an identity), has inverses for finite numbers (-x; only works for identity 0), closed
Subtractionx - y`x - y`Nonassociative, noncommutative, has right identity (0), closed
Multiplicationxy or x×y or x·y`x * y`Nonassociative, commutative, has identity (1), has inverses for finite nonzero numbers (1/x), closed
Divisionx/y, x ÷ y`x / y`Nonassociative, noncommutative, has right identity (1), partial (can't divide by 0, ∞/∞ is undefined)
Exponents/powersxy`x ^ y`Nonassociative, noncommutative, has right identity (1)
Exponentsex, exp x`exp x`Closed, fixed point (∞)
Natural logarithmsln x`ln x`Closed, fixed point (∞)
Logarithmslogb x`log_b x`
Square roots√x`sqrt x`
Absolute value|x|`|x|` or `abs x`total, has fixed points (all non-negative numbers and NaN)

Info: Cardinal numbers

Cardinal numbers are a type of number used in set theory for describing the sizes of sets. Cardinal numbers include all the natural numbers (0, 1, 2, etc.) and also infinite numbers, the smallest of which is ℵ0 (which you can enter into this program by typing `a0`), which represents the size of the set of natural numbers (sets with this cardinality are called countable). Negative numbers and fractions are not cardinal numbers, because sets can't have negative numbers or fracations of elements.

Many well-known arguments showing things about sizes of infinity are about the cardinal numbers. Hilbert's hotel shows that a hotel with infinitely many guests can accomodate one more guest without any more rooms; this corresponds to the fact that ℵ0 + 1 = ℵ0. The diagram here shows that the set of positive rationals (or the set of ordered pairs of natural numbers) is countable; this corresponds to the fact that ℵ02 = ℵ0. Cantor's diagonal argument shows that the set of all real numbers, and also the set of all subsets of the natural numbers (called the power set of the natural numbers), are both uncountable; this corresponds to the fact that 20 > ℵ0.

What types of infinite cardinal numbers there are depends on which axioms of set theory you're using. This program uses Zermelo-Fraenkel set theory with the axiom of choice (ZFC), and assumes that the generalized continuum hypothesis is true.

Infinite cardinals in ZFC can be written as either ℵn (Hebrew letter aleph) or ℶn (Hebrew letter beth), where n is any ordinal number. The aleph numbers include all infinite cardinal numbers in order; that is, ℵ0 is the first infinite cardinal, ℵ1 is the second infinite cardinal, ℵ2 is the third infinite cardinal, etc. The beth numbers, on the other hand, only include infinite numbers that are 2 to the power of some other beth number [not quite true starting at ℶω]; that is, ℶ0 = ℵ0, ℶ1 = 20, ℶ2 = 21, etc. The generalized continuum hypothesis states that the aleph numbers and the beth numbers are the same.

No cardinality (proper class); superclass of: ℕ

Supported operations

OperationStandard notationType asPropertiesMeaning
Smallest infinite cardinal0`a0` or `aleph_0`Size of ℕ
Aleph numbersx`ax` or `aleph_x`xth cardinal number
Beth numbersx`bx` or `beth_x`The size of the power set of the previous beth number
Additionx + y`x + y`Associative, commutative, has identity (0), no inverses, closedThe size of the union of two disjoint sets
Subtractionx - y`x - y`Nonassociative, noncommutative, has right identity (0), partial (not defined when x < y or when x and y are the same infinite cardinal)Opposite of addition
Multiplicationxy or x·y`x * y` or `xy`Associative, noncommutative, has identity (1), no inverses, closedSize of a cross product
Exponents/powersxy`x ^ y`Nonassociative, noncommutative, has right identity (1)Size of the set of all functions from a set of size y to a set of size x

Info: Ordinal numbers

Ordinal numbers are a type of number used in set theory for describing well orderings of sets. Ordinal numbers include all the natural numbers (0, 1, 2, etc., but not fractions like ½ or negative numbers like -1) and a lot of infinite numbers. (And by "a lot", I mean, there are more than any set, even infinite sets. Of course, this program can't handle all of them.) The smallest infinite ordinal is ω (which you can enter in this program by typing `w`), and other infinite ordinals can be constructed by adding, multiplying, and using powers. Neither addition nor multiplication of ordinals is commutative.

There are also other ordinal numbers (such as ε0 and Γ0 and ω1), but this program doesn't yet support them.

A well order is a total order—that is, for any two elements, one is less than the other, or they're equal—with the property that every nonempty subset has a least element. For instance, the usual way of ordering natural numbers (0, 1, 2, 3, ...) is a well order (any subset has a least element), but the usual way of ordering the integers (..., -3, -2, -1, 0, 1, 2, 3, ...) is not, because the set of all negative numbers has no least element, and neither is the usual ordering of nonnegative fractions, because the subset that contains only positive (nonzero) fractions has no smallest element. However, there are other ways of ordering these sets that are well orders; for instance, 0, 1, 2, 3, ..., -1, -2, -3, ... is a well order of the integers, and 0/1, 1/1, 2/1, ..., 1/2, 3/2, 5/2, ..., 1/3, 2/3, 4/3, 5/3, ..., ...... is a well order of the nonnegative rational numbers.

In any well order, both the positions of the elements and the size of the whole set can be described by ordinal numbers.

No cardinality (proper class); superclass of: ℕ

Supported operations

OperationStandard notationType asProperties
Smallest infinite ordinalω`w` or `omega`
Additionx + y`x + y`Associative, noncommutative, has identity (0), no inverses, closed
Multiplicationxy or x·y`x * y` or `xy`Associative, noncommutative, has identity (1), no inverses, closed
Exponents/powersxy`x ^ y`Nonassociative, noncommutative, has right identity (1)

I had to figure out ordinal powers myself; I hope I did it right.

Info: Supernatural numbers

Like natural numbers, except that the prime factorization can have primes raised to infinity, and can have an infinite number of primes (though the latter isn't supported by this program). Addition and subtraction aren't defined for supernatural numbers, but multiplication and division are, as are greatest common divisor and least common multiple

Supported operations

OperationStandard notationType asProperties
Infinity`inf`Only allowed in exponents (e.g., `2^inf`)
Multiplicationxy or x×y or x·y`x * y`closed, associative, commutative, distributive over gcd and lcm, has identity (1), has absorbing element (∏p), no inverses
Divisionx/y, x ÷ y`x / y`partial (only some pairs of numbers are divisible), nonassociative, noncommutative, has right identity (1), has left absorbing element (∏p)
Exponents/powersxy`x ^ y`y is an integer or ∞, nonassociative, noncommutative, has right identity (1), has left absorbing element (∏p)
GCDgcd(x, y) or (x, y)`gcd(x, y)` or `(x, y)`closed, associative, commutative, has identity (0), has absorbing element (1), distributive over LCM
LCMlcm(x, y) or [x, y]`lcm(x, y)` or `[x, y]`closed, associative, commutative, has identity (1), has absorbing element (0), distributive over GCD

Info: Boolean algebra

The two-element boolean algebra deals with truth values (0/false/no, 1/true/yes), with the operations "and" (represented as multiplication) and "or" (represented as addition). Unlike ordinary numbers, addition and multiplication distribute over each other. This differs from integers mod 2 in that + represents "or" here, but "xor" in integers mod 2.

Cardinality: 2; structure: boolean algebra (commutative monoid with both + and ·); subset of: ℕ (sort of)

Supported operations

OperationStandard notationType asProperties
True1 or ⊤`1`
False0 or ⊥`0`
Orx + y or xy`x + y`Associative, commutative, has identity (0), closed
Andxy or xy`x * y`Associative, commutative, has identity (1), closed
Not¬x or `~x`Closed

Info: Modular arithmetic

Modular arithmetic deals with numbers that wrap around; that is, if you add some number n, you get back to where you started. Various things that can be represented with modular arithmetic:

• Seconds within a minute, minutes within an hour, hours within a day
• Days of the week (mod 7)
• Notes within a scale (mod 7 for diachronic scales (major, minor, etc.); mod 12 for chromatic scales). The fact that the circle of fifths exists can be expressed as a fact about mod 12 arithmetic; specifically, that any mod 12 number can be made by multiplying something by 7 (a fifth is 7 half-steps), and that multiplying 7 by 12 gives 0 mod 12.
• Mod 10 arithmetic is the same as taking the last digit of a (base 10) number, at least when the number's positive.

Cardinality: n; structure: commutative ring, field if n is prime; subset of: ℕ (sort of)

Supported operations

OperationStandard notationType asProperties
Additionx + y`x + y`Associative, commutative, has identity (0), has inverses, closed
Subtractionx - y`x - y`Nonassociative, noncommutative, has right identity (0), closed
Multiplicationxy or x×y or x·y`x * y` or `xy`Associative, commutative, has identity (1), has inverses for numbers coprime with n, closed
Inversesx-1`1 / x or x^-1`Partial
Exponents/powersxy`x ^ y`Nonassociative, noncommutative, has right identity (1); y is not interpreted mod n
Square roots√x`sqrt x`Partial

Info: Reals mod n (ℝ/ℤ)/Circle group

This is actually two things:

• Reals mod n: The real-number equivalent of integers mod n. Unlike integers, reals mod n can't be multiplied or divided, since for instance in reals mod 1, 0.5×0.5 could correspond either to 0.25 or 0.75. Also unlike integers, reals mod n have the exact same structure no matter what n is. For reals mod 1, this is the fractional part of the number (for positive numbers); reals mod τ (= 2π) or 360 can be used to represent angles.
• Circle group: The subset of the complex numbers whose absolute value is 1. On the complex plane, this looks like a circle. All such numbers have the form eix, where x is some real number. These wrap around at τ; that is, eiτ = 1 = ei0.

These groups are all isomorphic; that is, each element of the circle group corresponds to exactly one element of the reals mod n (for any n) and vice versa, and if you multiply two elements in the circle group, and you add their corresonding elements in the reals mod n, the result in the circle group corresponds to the result in the reals mod n. (Or, in other words, they can be thought of as the same group, just with different names for the elements and operations.)

Cardinality: ℶ1; structure: abelian group; subset of: ℝ (sort of, for reals mod n) or ℂ (for the circle group)

Supported operations

For reals mod n (additive group):

OperationStandard notationType asProperties
Additionx + y`x + y`closed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - y`x - y`closed, nonassociative, noncommutative, has right identity (0)

For the circle group:

OperationStandard notationType asProperties
Element of the groupexi`e^(x*i)` or `exp(x*i)`
1, -1, i, -i`1`, `-1`, `i`, `-i`
Multiplicationxy or x×y or x·y`x * y`closed, associative, commutative, has identity (1), no absorbing element (0 is not part of the group), has inverses (1/x)
Divisionx/y, x ÷ y`x / y`closed, nonassociative, noncommutative, has right identity (1), no left absorbing element

With normal real numbers, you can have numbers where the digits go on to the right of the decimal point infinitely (e.g., 3.333333… or 3.14159265…). p-adic numbers are similar, except you can have infinite digits to the left, so you can have numbers like …33333333. (There can still be a decimal point; however, there can only be finitely many digits to the right of it.)

What numbers you can have depends on the choice of base (the variable p represents the base), so a 2-adic (i.e., base 2) number doesn't necessarily have a corresponding 3-adic number; and a real number doesn't necessarily have a corresponding p-adic number, and vice versa. However, regardless of the base, all rational numbers can be represented.

Negative numbers can be represented as p-adic numbers without using a minus sign. For instance, -1 as a 10-adic number is …999999, because if you add 1 to that, the last digit becomes 0, the 1 is carried, the next digit becomes 0, a 1 is carried again, and so on infinitely so all digits end up 0. In general, for any base p, negative integers start with an infinite number of p-1 digits.

In p-adic numbers, numbers are considered to be close together if enough digits at the end of the number are the same.

Cardinality: ℶ1; structure: field if p is prime, otherwise commutative ring; superset of: ℕ, ℤ, ℚ

Non-prime p

Normally, prime bases are used. For this program, currently addition, subtraction, and multiplication work for all bases, but division and square root only work correctly for prime bases. For non-prime bases (that aren't powers of primes), you can get non-zero numbers that when multiplied together equal zero. Enter two coprime numbers that aren't 1 below to see an example of such numbers.

p = ×

Supported operations

If "interpret input as base p" is checked, you can enter digits higher than 10 by separating each digit with spaces or colons, or by using letters (like in hexadecimal). Also, quote notation is supported; that is, if you put an apostrophe in a number, everything to the left of the apostrophe will be repeated infinitely. If "interpret input as base p" is not checked, numbers you type will be treated as base 10 integers and converted to base p.

OperationStandard notationType asPropertiesNotes
Additionx + y`x + y`Associative, commutative, has identity (…000), has inverses, closed
Subtractionx - y`x - y`Nonassociative, noncommutative, has right identity (…000), closed
Multiplicationxy or x×y or x·y`x * y` or `xy`Associative, commutative, has identity (…001), has inverses if p is prime, closed
Divisionx/y, x ÷ y`x / y`Nonassociative, noncommutative, has right identity (1), partial (can't divide by 0)This program assumes p is prime
Square roots√x`sqrt x`Partial (depends on last digit)2-adic square roots currently not supported; this program assumes p is prime