Jump to content

Wikifunctions:Catalogue/Number operations

From Wikifunctions

Numeric Characteristics

Comparisons

Comparison functions for Natural number (Z13518)
n1 n2
Q110013332
unequal natural numbers (Z14416) n1 n2
Q7797295
sign of difference (Z16731)
n1 < n2
Q52834024
less than (natural numbers) (Z13689) n1 > n2
Q47035128
greater than (natural numbers) (Z13676)
n1 n2
Q55935272
less than or equal (natural numbers) (Z13695) n1 n2
Q55935291
greater than or equal (natural numbers) (Z13682)
n1 = n2
Q842346
equality of natural numbers (Z13522) n1 n2
Q26161438
n 0 is Natural number not zero? (Z35693)
n = 0 is zero (natural number) (Z23883)
n = 1 is Natural number 1? (Z31547) n = 2 is Natural number 2? (Z31554)
n1 n2 n3 Natural number is between (Z14711)
n1 n2
Q109497082
is natural number divisible (Z13740)
gcd(n1, n2) = 1
Q104752
are coprime (natural numbers) (Z13701)

Selections

Arithmetic Functions

Natural number sequences and unary natural number functions

See Wikifunctions:OEIS

Bitwise Functions

Number conversions

Conversion functions for Natural number (Z13518)
natural number to digit string (Z13713) String (Z6)
(decimal (Q81365))
string of digits as Natural Number (Z14283)
natural number to byte (Z22535) Byte (Z80) byte to natural number (Z14567)
natural number to integer (Z17101) Integer (Z16683) integer to exact natural number or 0 (Z20391)
absolute value of integer as natural number (Z17144)
natural number as rational number (Z21653) Rational number (Z19677)
natural number to float64 (Z20936) float64 (Z20838)
By base
By system
Other

Integer functions

Construction and deconstruction functions for Integer (Z16683)
make Integer (Z33745) Z16683K1: Sign (Z16659) sign of integer (Z17105)
Z16683K2: Natural number (Z13518) absolute value of integer as natural number (Z17144)
Conversion functions for Integer (Z16683)
integer to digit string (hyphen negative) (Z25073) String (Z6)
ordered pair of natural numbers representing integer (Z17301) <Z13518>[ a, b ] integer represented by ordered pair of natural numbers (Z17307)
Comparison functions for Integer (Z16683)
n1 n2
Q110013332
are Integers different? (Z35475) n1 n2
Q7797295
Sign of difference of Integers (Z35449)
n1 < n2
Q52834024
less than (integer) (Z17140) n1 > n2
Q47035128
greater than (integer) (Z17132)
n1 n2
Q55935272
less than or equal (integer) (Z17363) n1 n2
Q55935291
greater than or equal (integer) (Z17173)
n1 = n2
Q842346
same Integer (Z16688) n1 n2
Q26161438
n 0 is Integer not zero? (Z35702) n 0 sign of integer (Z17105)
n < 0 is negative integer (Z17215) n > 0 is positive integer (Z17204)
n 0 is Integer non-positive? (Z35709) n 0 is non-negative integer (Z17229)
n = 0 is zero (integer) (Z17239)
n1 n2 n3 Integer in range (Z17591)
n1 n2 mod m
Q3773677
are Integers congruent modulo other Integer? (Z32261)
|n1| = |n2| integers have the same absolute magnitude (Z17254)
sgn(n1) = sgn(n2) integers have the same sign (Z17249)
n1 n2
Q109497082
is integer divisible (Z20266)

Integer functions using set-theoretic representation with pairs of natural numbers

see w:Integer#Equivalence classes of ordered pairs

Integer sequence and unary integer functions

See Wikifunctions:OEIS

Search for

Functions expecting or returning an explicit Integer object, singly or in a list

Rational number functions

Construction and deconstruction functions for Rational number (Z19677)
rational from sign and natural numbers (Z20584) Z19677K1: Sign (Z16659) sign of rational number (Z19717)
Z19677K2: Natural number (Z13518) numerator of unsimplified rational number (Z19733)
Z19677K3: Natural number (Z13518) denominator of unsimplified rational number (Z19862)
unsimplified rational from Z, N (Z27836) K1, K2 signed numerator of unsimplified Rational number (Z35847)
K3 Z19862
rational from integer numerator and denominator (Z19848) K1, K2
K1, K3

Comparison

Comparison functions for Rational number (Z19677)
q1 q2
Q110013332
are Rational numbers different? (Z35727) q1 q2
Q7797295
Sign of difference of Rational numbers (Z35721)
q1 < q2
Q52834024
less than (rational numbers) (Z19753) q1 > q2
Q47035128
Greater than (rational numbers) (Z19751)
q1 q2
Q55935272
less than or equal to (rational numbers) (Z19754) q1 q2
Q55935291
Greater than or equal to (rational numbers) (Z19752)
q1 = q2
Q842346
same Rational number (Z19686) q1 q2
Q26161438
same rational within tolerance (Z24506)
q 0 q 0 sign of rational number (Z19717)
q < 0 is negative rational number (Z21714) q > 0 is positive rational number (Z21702)
q 0 is Rational number non-positive? (Z35714) q 0 is non-negative rational number (Z21721)
q = 0 Is rational number 0 (Z19922)
q = 1 is rational number 1? (Z25200)
a = c ∧ b = d same Rational number object (Z19892)
q1 q2 q3 is rational in range (inclusive) (Z24403)
q1 = q2-1 Are rational numbers multiplicative inverse? (Z19931)

Properties

Transformation and conversion

Conversion functions for Rational number (Z19677)
Rational number to string (Z19827) String (Z6)
(reducible fraction (Q11922681))
string to rational number (Z19866)
display rational as formatted decimal inferring sf (Z25656) String (Z6)
(decimal number (Q20154908))
Z19866
Rational number as float (Z20854) float64 (Z20838) float as rational (Z21071)

Rounding

Rounding functions for Rational number (Z19677)
3/2 1/1
4/4
3/4 1/2
2/4
1/3 0/1
0/4
1/3 1/2
2/4
3/4 1/1
4/4
3/2
.# ±
.# 0
trunc
Q1080547
(q) q
(q) z
Z19682
-1 0
0
0 0
0
0 0
0
0 0
0
0 1
1
1
frac
Q2366982
Z23934 0/1 0/1
0/1
0/1 0/1
0/1
0/1 0/1
0/1
1/3 1/2
1/2
3/4 0/1
0/1
1/2
.# +
ceil
Q12718884
(q) q
(q) z
Z20053
0 -1
0
0 0
0
0 0
0
1 1
1
1 1
1
2
.#
floor
Q56860783
(q) q
(q) z
Z20032
0 0
-1
0 0
0
0 0
0
0 0
0
0 1
1
1
Q6583251 .5 ±
.5 0
.5 0 mod 2
IEEE 754
(q) q
(q) z
Z19841
0 -1
-1
-1 0
0
0 0
0
0 0
0
1 1
1
2
More info at enwp:Rounding
fraction as hex (2 digit uppercase) (Z28645) 00
00
55 7F
7F
BF FF
FF

Operations

Operations with custom precision

Probability Operations

Probability mass functions

Floating point functions

Construction and deconstruction functions for float64 (Z20838)
Z20838K1: Sign (Z16659) extract sign of floating point number (Z21136)
Z20838K2: Integer (Z16683) exponent of floating point number (Z21139)
Z20838K3: Natural number (Z13518) significand of floating point number (Z21142)
Z20838K4: Floating point special value (Z20825) special value of floating point (Z21145)

Properties

Conversions

Comparisons

Rounding

Rounding functions for float64 (Z20838)
-inf -1.5 -1.0 -0.75 -0.5 -0.3 0.0
-0.0
0.3 0.5 0.75 1.0 1.5 inf nan
.# ±
.# 0
trunc
Q1080547
(f) f
(f) z
Z21534
Content error -1 -1 0 0 0 0
0
0 0 0 1 1 Content error Content error
frac
Q2366982
.# +
ceil
Q12718884
(f) f
Z21043
-inf -1.0 -1.0 -0.0 -0.0 -0.0 0.0
-0.0
1.0 1.0 1.0 1.0 2.0 inf nan
(f) z
.#
floor
Q56860783
(f) f
(f) z
Z20841
Content error -2 -1 -1 -1 -1 0
0
0 0 0 1 1 Content error Content error
Q6583251 .5 ±
.5 0
.5 0 mod 2
IEEE 754
(f) f
Z26304
Content error -2.0 -1.0 -1.0 0.0 0.0 0.0
0.0
0.0 0.0 1.0 1.0 2.0 Content error Content error
(f) z
Z26315
Content error -2 -1 -1 0 0 0
0
0 0 1 1 2 Content error Content error
More info at enwp:Rounding
float as rational (Z21071) Content error −3/2 −1/1 −3/4 −1/2 −5404319552844595/18014398509481984 0/1
0/1
5404319552844595/18014398509481984 1/2 3/4 1/1 3/2 Content error Content error
display float64 as hex string (Z21148) FFF0000000000000 BFF8000000000000 BFF0000000000000 BFE8000000000000 BFE0000000000000 BFD3333333333333 0000000000000000
8000000000000000
3FD3333333333333 3FE0000000000000 3FE8000000000000 3FF0000000000000 3FF8000000000000 7FF0000000000000 7FF8000000000000
display float64 as binary string (Z21158)

Operations

Search for

Functions expecting or returning an explicit Float64 object, singly or in a list

Complex numbers

Type: Complex number (float64) (Z33198): a complex number approximated by two float64 values

Construction and deconstruction functions for Complex number (float64) (Z33198)
complex128 from real and imaginary parts (Z33227) Z33198K1: float64 (Z20838) real part (Z33214)
Z33198K2: float64 (Z20838) imaginary part (Z33221)
complex128 from magnitude and angle (Z33304) K1, K2 magnitude of complex128 (Z33499)
K1, K2 argument of Complex number (Z33610)

Constructor and deconstructors

Comparison

Arithmetics

Number operations requiring type conversion

Numeric Characteristics

Arithmetic Functions

Trigonometric Functions

Health Functions

Geometric Functions

These would benefit from a float type.

Distance functions

Physics functions

Randomness

Reminder that Wikifunctions does not support randomness for now. We always expect all functions to return functional, deterministic results, only dependent on the input. This is in order to allow for aggressive caching. see Wikifunctions:Project_chat/Archive/2023/09#Help_please.