Number types

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

Number type:

p =

Octonion basis:

Input:

Result:

General info

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

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 + yx + y
Subtractionx - yx - y
Multiplicationxy or x×y or x·yx * y or xy
Divisionx/y, x ÷ yx / y
Exponents/powersxyx ^ y
Exponentsex, exp xexp x
Natural logarithmsln xln x
Logarithmslogb xlog_b x
Square roots√xsqrt 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: ℤ, ℚ, ℝ, ℂ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Additionx + yx + yclosed, associative, commutative, has identity (0), no inverses
Subtractionx - yx - ypartial, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * yclosed, associative, commutative, distributive over + and -, has identity (1), possibly has absorbing element (0), no inverses
Divisionx/y, x ÷ yx / ypartial (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/powersxyx ^ ypartial (y must be non-negative), nonassociative, noncommutative, distributive over × and ÷, has right identity (1), has left absorbing element (0)
Logarithmslogb xlog_b x
Square roots√xsqrt xpartial (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: ℚ, ℝ, ℂ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * yclosed, associative, commutative, distributive over + and -, has identity (1), has absorbing element (0), no inverses
Divisionx/y, x ÷ yx / ypartial (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/powersxyx ^ ypartial (y must be non-negative), nonassociative, noncommutative, distributive over × and ÷, has right identity (1)
Logarithmslogb xlog_b x
Square roots√xsqrt xpartial (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 xtotal, 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: ℂ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * yclosed, associative, commutative, distributive over + and -, has identity (1), has absorbing element (0), has inverses (1/x)
Divisionx/y, x ÷ yx / ypartial (can't divide by 0), nonassociative, noncommutative, right-distributive over + and -, has right identity (1), has left absorbing element (0)
Exponents/powersxyx ^ ypartial (e.g. -11/2 is undefined), nonassociative, noncommutative, distributive over × and ÷, has right identity (1)
Exponentsex, exp xexp xtotal, monotonically increasing, no fixed points, one-to-one
Natural logarithmsln xln xpartial (not defined for x ≤ 0), monotonically increasing, no fixed points, bijection (from domain where it's defined to ℝ)
Logarithmslogb xlog_b x
Square roots√xsqrt xpartial (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: ℕ, ℤ, ℚ, ℝ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Imaginary unitii
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * y or xyclosed, associative, commutative, distributive over + and -, has identity (1), has inverses (1/x)
Divisionx/y, x ÷ yx / ypartial (can't divide by 0), nonassociative, noncommutative, right-distributive over + and -, has right identity (1)
Exponents/powersxyx ^ ynonassociative, noncommutative, has right identity (1)
Exponentsex, exp xexp xtotal
Natural logarithmsln xln x
Logarithmslogb xlog_b x
Square roots√xsqrt x
Absolute value|x||x| or abs xtotal, has fixed points (all non-negative real numbers)
Conjugate or x*conj xtotal, 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: ℕ, ℤ, ℚ, ℝ

More info: Wikipedia

Supported operations

OperationStandard notationType asProperties
Imaginary unitjj
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * y or xyclosed, associative, commutative, distributive over + and -, has identity (1)
Divisionx/y, x ÷ yx / ypartial (can't divide by numbers of the form a ± aj), nonassociative, noncommutative, right-distributive over + and -, has right identity (1)
Exponents/powersxyx ^ ynonassociative, noncommutative, has right identity (1)
Exponentsex, exp xexp x
Natural logarithmsln xln x
Logarithmslogb xlog_b x
Square roots√xsqrt x
Absolute value|x||x| or abs xtotal, has fixed points (all non-negative real numbers)
Conjugate or x*conj xtotal, 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: ℕ, ℤ, ℚ, ℝ

More info: Wikipedia

Supported operations

OperationStandard notationType asProperties
Imaginary unitεepsilon or ep
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * y or xyclosed, associative, commutative, distributive over + and -, has identity (1)
Divisionx/y, x ÷ yx / ypartial (can't divide by numbers whose real part is 0), nonassociative, noncommutative, right-distributive over + and -, has right identity (1)
Exponents/powersxyx ^ ynonassociative, noncommutative, has right identity (1)
Exponentsex, exp xexp xtotal
Natural logarithmsln xln x
Logarithmslogb xlog_b x
Square roots√xsqrt x
Conjugate or x*conj xtotal, 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: ℕ, ℤ, ℚ, ℝ, ℂ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Imaginary unitsi, j, ki, j, k
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * y or xyclosed, associative, noncommutative, has identity (1), has inverses (x-1)
Exponentsex, exp xexp xtotal
Natural logarithmsln xln x
Logarithmslogb xlog_b x
Square roots√xsqrt x
Conjugate or x*conj xtotal, has fixed points (all real numbers), bijection

This program does not yet support powers or division of quaternions

Info: Octonions (𝕆)

Similar to the complex numbers and quaternions, except that there are seven imaginary units, e1 through e7, all of which square to -1. Unlike complex numbers, multiplication is not commutative, and unlike complex numbers and quaternions, multiplication is not associative.

This program supports two different ways of labeling the elements; one is the table currently on the Wikipedia article; the other follows a nicer pattern, where e1e2 = e4.

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

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Imaginary unitsen or in (1 ≤ n ≤ 7)e_n, i_n
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * y or xyclosed, nonassociative, noncommutative, has identity (1), has inverses (x-1)
Conjugate or x*conj xtotal, has fixed points (all real numbers), bijection

Info: Sedenions (𝕊)

Similar to the complex numbers, quaternions, and octonions, except that there are fifteen imaginary units, e1 through e15, all of which square to -1. Unlike complex numbers, multiplication is not commutative, and unlike complex numbers and quaternions, multiplication is not associative.

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

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Imaginary unitsen or in (1 ≤ n ≤ 15)e_n, i_n
Additionx + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * y or xyclosed, nonassociative, noncommutative, has identity (1)
Conjugate or x*conj xtotal, has fixed points (all real numbers), bijection

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: ℕ, ℤ, ℚ, ℝ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Additionx + yx + ypartial (∞ + -∞ undefined), associative, commutative, has identity (0), has inverses for finite numbers (-x)
Subtractionx - yx - ypartial, nonassociative, noncommutative, has right identity (0)
Multiplicationxy or x×y or x·yx * ypartial (∞·0 is undefined), associative, commutative, has identity (1), has inverses for finite nonzero numbers (1/x)
Divisionx/y, x ÷ yx / ypartial (can't divide by 0, ∞/∞ is undefined), nonassociative, noncommutative, has right identity (1)
Exponents/powersxyx ^ ynonassociative, noncommutative, has right identity (1)
Exponentsex, exp xexp xtotal, fixed point (∞)
Natural logarithmsln xln xpartial (not defined for x < 0), fixed point (∞)
Logarithmslogb xlog_b x
Square roots√xsqrt x
Absolute value|x||x| or abs xtotal, 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: ℕ, ℤ, ℚ, ℝ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Additionx + yx + yAssociative, commutative, has identity (0), has inverses for finite numbers (-x), partial (∞ + ∞ undefined)
Subtractionx - yx - yNonassociative, noncommutative, has right identity (0), partial
Multiplicationxy or x×y or x·yx * yAssociative, commutative, has identity (1), has inverses for finite nonzero numbers (1/x), partial (∞·0 is undefined)
Divisionx/y, x ÷ yx / yNonassociative, 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:

There are also positive and negative zero.

Cardinality: 18437736874454810627 (= 264 - 253 + 3)

More information: Wikipedia (and 64-bit numbers in particular)

Supported operations

OperationStandard notationType asProperties
Additionx + yx + yNonassociative, 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 - yx - yNonassociative, noncommutative, has right identity (0), closed
Multiplicationxy or x×y or x·yx * yNonassociative, commutative, has identity (1), has inverses for finite nonzero numbers (1/x), closed
Divisionx/y, x ÷ yx / yNonassociative, noncommutative, has right identity (1), partial (can't divide by 0, ∞/∞ is undefined)
Exponents/powersxyx ^ yNonassociative, noncommutative, has right identity (1)
Exponentsex, exp xexp xClosed, fixed point (∞)
Natural logarithmsln xln xClosed, fixed point (∞)
Logarithmslogb xlog_b x
Square roots√xsqrt x
Absolute value|x||x| or abs xtotal, 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: ℕ

More information: Wikipedia

Supported operations

OperationStandard notationType asPropertiesMeaning
Smallest infinite cardinal0a0 or aleph_0Size of ℕ
Aleph numbersxax or aleph_xxth cardinal number
Beth numbersxbx or beth_xThe size of the power set of the previous beth number
Additionx + yx + yAssociative, commutative, has identity (0), no inverses, closedThe size of the union of two disjoint sets
Subtractionx - yx - yNonassociative, 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·yx * y or xyAssociative, noncommutative, has identity (1), no inverses, closedSize of a cross product
Exponents/powersxyx ^ yNonassociative, 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: ℕ

More information: Wikipedia

Supported operations

OperationStandard notationType asProperties
Smallest infinite ordinalωw or omega
Additionx + yx + yAssociative, noncommutative, has identity (0), no inverses, closed
Multiplicationxy or x·yx * y or xyAssociative, noncommutative, has identity (1), no inverses, closed
Exponents/powersxyx ^ yNonassociative, 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

More info: Wikipedia

Supported operations

OperationStandard notationType asProperties
InfinityinfOnly allowed in exponents (e.g., 2^inf)
Multiplicationxy or x×y or x·yx * yclosed, associative, commutative, distributive over gcd and lcm, has identity (1), has absorbing element (∏p), no inverses
Divisionx/y, x ÷ yx / ypartial (only some pairs of numbers are divisible), nonassociative, noncommutative, has right identity (1), has left absorbing element (∏p)
Exponents/powersxyx ^ yy 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)

More info: Wikipedia

Supported operations

OperationStandard notationType asProperties
True1 or ⊤1
False0 or ⊥0
Orx + y or xyx + yAssociative, commutative, has identity (0), closed
Andxy or xyx * yAssociative, commutative, has identity (1), closed
Not¬x or ~xClosed

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:

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

More info: Wikipedia

Supported operations

OperationStandard notationType asProperties
Additionx + yx + yAssociative, commutative, has identity (0), has inverses, closed
Subtractionx - yx - yNonassociative, noncommutative, has right identity (0), closed
Multiplicationxy or x×y or x·yx * y or xyAssociative, commutative, has identity (1), has inverses for numbers coprime with n, closed
Inversesx-11 / x or x^-1Partial
Exponents/powersxyx ^ yNonassociative, noncommutative, has right identity (1); y is not interpreted mod n
Square roots√xsqrt xPartial

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

This is actually two things:

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.)

More information: Wikipedia (circle group)

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 + yx + yclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionx - yx - yclosed, nonassociative, noncommutative, has right identity (0)

For the circle group:

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

Info: p-adic numbers

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: ℕ, ℤ, ℚ

More info: Wikipedia

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 + yx + yAssociative, commutative, has identity (…000), has inverses, closed
Subtractionx - yx - yNonassociative, noncommutative, has right identity (…000), closed
Multiplicationxy or x×y or x·yx * y or xyAssociative, commutative, has identity (…001), has inverses if p is prime, closed
Divisionx/y, x ÷ yx / yNonassociative, noncommutative, has right identity (1), partial (can't divide by 0)This program assumes p is prime
Integer powersxnx ^ nHas right identity (1)Currently doesn't work if "Interpret input as base p" is checked
Exponentsexpp xexp xPartial (only works for numbers ending in 0, and for p = 2, numbers ending in 00)Exponents and logarithms; this program assumes p is prime
Logarithmslogp xlog xPartial (not defined for 0), not injectiveIwasawa logarithm; this program assumes p is prime
Square roots√xsqrt xPartial (depends on last digit)this program assumes p is prime

Info: Polynomials (R[x])

Not really numbers. These are expressions of the form anxn + an - 1xn - 1 + … + a1x1 + a0x0. Currently only polynomials of one variable are supported.

Division at the top level does polynomial long division and shows the quotient and remainder. If you use division as part of a larger expression, then this program will give an error if the first polynomial isn't divisible by the second.

Cardinality: |R| (assuming R is infinite); structure: commutative ring

More information: Wikipedia (Polynomial, Polynomial ring)

Supported operations

OperationStandard notationType asProperties
Variablexx
Additionp + qp + qclosed, associative, commutative, has identity (0), has inverses (-x)
Subtractionp - qp - qclosed, nonassociative, noncommutative, has right identity (0)
Multiplicationpq or p·qp * qclosed, associative, commutative, distributive over + and -, has identity (1), has absorbing element (0), no inverses
Divisionp/qp / qpartial (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)
Powerspnp ^ nrequires n to be a natural number
GCDgcd(p, q) or (p, q)gcd(p, q)closed, associative, commutative, has identity (0), has absorbing element (1), distributive over LCM
LCMlcm(p, q) or [p, q]lcm(p, q)closed, associative, commutative, has identity (1), has absorbing element (0), distributive over GCD