Wikifunctions:Catalogue/Number operations
Appearance
Numeric Characteristics
- is Natural number (Z15818): returns True if the argument is a Natural number, otherwise False (unless error)
- is zero (natural number) (Z23883): true if the argument is 0, otherwise false
- is prime (Z12427): True, if the provided natural number is prime (i.e., it has exactly 2 positive divisors).
- is semiprime (Z14953): True, if argument is a natural number that is the product of exactly two prime numbers.
- is factorial (Z14961): Description missing
- is square number (Z15190): Description missing
- is square-free integer (Z15276): Description missing
- is power of 2 (Z15735): Description missing
- is power of k (Z15741): Description missing
- is perfect kth power (Z15251): Description missing
- is perfect number (Z14933):
- is superperfect number (Z14999): Description missing
- is semiperfect number (Z14980): Description missing
- is factorial prime (Z14966): Description missing
- is perfect power (Z15265): check if a natural number n is a perfect power (i.e., there exist natural numbers m > 1 and k > 1 such that m^k = n)
- divisors (Z13726): For a given number return a list of natural numbers that divide the given number without remainder. Return in ascending order.
- is (m,k)-perfect number (Z15007): Description missing
- is Armstrong number (Z12636): Sum of individual digit to the power total number of digits is equal to original number.
- is Carmichael number (Z14683): returns true if the input is a Carmichael number, otherwise false
- is Cunningham number (Z15757): check if a natural number is of form a^b+1 or a^b-1, where a,b>=2
- is Fermat pseudoprime (Z14783): Description missing
- is Fibonacci number (Z15617): Description missing
- is Lucas–Carmichael number (Z15282): Description missing
- is Poulet number (Z14792): Description missing
- is Størmer number (Z15201): A number n is a Størmer number if the greatest prime factor of n^2 + 1 is greater than 2n.
- is Wieferich number (Z14815): Description missing
- is Wieferich prime (Z14810): Description missing
- is abundant number (Z14976):
- is arithmetic number (Z15031): Description missing
- is deficient number (Z14971):
- is eban number (Z15151): check if a number contains 'e' when spelled out in English (A006933)
- is evil number (Z15127): returns "true" if the given number is an evil number (a positive integer with an even number of 1s in its binary representation), otherwise "false"
- is harmonic divisor number (Z14924): Description missing
- nth centered k-gonal number (Z15443): also see Z15500 for non-centered polygonal number
- is k-almost prime (Z14946): Description missing
- is k-hyperperfect number (Z14938): Description missing
- is k-perfect number (Z15018): Description missing
- is k-rough number (Z15241): Description missing
- is k-smooth number (Z15218): Description missing
- is m-superperfect number (Z15013): Description missing
- is odious number (Z15121): Description missing
- is palindromic number (Z15050): returns "true" if the given number is a palindrome number, otherwise "false"
- is palindromic prime (Z15055): returns "true" if the given number is a palindrome prime, otherwise "false"
- is refactorable number (Z15186): Description missing
- is regular number (Z15224): Description missing
- is sphenic number (Z14958): Description missing
- is strobogrammatic number (Z15195): Description missing
- is unusual number (Z15228): Description missing
- is weird number (Z14991): Description missing
Comparisons
| 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) | |||
- equality of natural numbers (Z13522): Checks if two natural numbers have the same value
- greater than (natural numbers) (Z13676): returns true if and only if the first number is strictly greater than the second
- greater than or equal (natural numbers) (Z13682): returns true if and only if the first number is greater than or equal to the second
- less than (natural numbers) (Z13689): returns true if the first is strictly less than the second
- less than or equal (natural numbers) (Z13695): returns true if and only if the first number is less than or equal to the second number
- sign of difference (Z16731): returns the sign of the subtraction: (first number - second number)
- are coprime (natural numbers) (Z13701): the only common factor of the two arguments is 1
- is natural number divisible (Z13740): true if the dividend (first number) is divisible by the divisor (second number) with no remainder
- is integer divisible (Z20266): Does the second number fit into the first number without a remainder?
- natural number is even (Z13555): true if the input is evenly divisible by 2
- is Natural number odd? (Z34353): Description missing
- first natural number is in closed interval of the other two (Z16773): Description missing
- same list of natural numbers (Z17628): Checks that two lists of natural numbers are the same. Repetitions and order matters.
- is simplified denominator divisible by factor (Z27811): returns true if the simplified denominator of the supplied rational number is divisible by the factor specified
Selections
- greater of two natural numbers (Z13630): returns the greater of the two arguments
- lesser of two natural numbers (Z13633): returns the lower of two natural numbers
- minimum of natural number list (Z19509): returns the smallest element from a list of natural numbers; if the list is empty, returns 0.
- maximum value on list (natural numbers) (Z29429): returns the largest element in the list
Arithmetic Functions
- Ones complement binary addition (Z12971): Performs binary addition using the ones complement method.
- Ones complement binary subtraction (Z12975): Performs binary subtraction using the ones complement method.
- add two Natural numbers (Z13521): adds two Natural numbers together, returning a Natural number
- increment natural number (Z13578): increase a natural number by one
- multiply two natural numbers (Z13539): calculate the product of two natural numbers
- divide natural numbers (Z13546): returns the integral portion of the result from dividing two natural numbers
- remainder of natural number division (Z13551): remainder from dividing two natural numbers
- absolute difference between natural numbers (Z13576): magnitude of the difference, independent of the order of arguments
- subtract natural numbers with floor of 0 (Z13569): subtracts the second natural number from the first, returns 0 if the second is larger
- subtract natural numbers as integer (Z17315): returns an integer as the subtraction of two natural numbers
- decrement natural number by one (Z13582): reduces the value of a natural number by one, with a floor of 0
- greatest common divisor (Z13612): returns the greatest common divisor of two natural numbers
- least common multiple (Z13660): Finds the lowest common multiple of two natural numbers.
- exponentiation of natural numbers (Z13647): raise base to a power
- natural number square root, python (Z15257): Description missing
- natural number square root (Z15256): Description missing
- hyperoperation (Z14732): H_n(a,b) = a[n]b
- factorial (Z13667): returns the factorial of a natural number
- alternating factorial (Z15143): Description missing
- hyperfactorial (Z15163): Description missing
- double factorial (Z13995): the product of all the positive integers up to n that have the same parity (odd or even) as n
- modular exponentiation (Z13818): returns the power of one natural number to another natural number, reduced mod a third natural number
- modular multiplicative inverse (Z13822): Description missing
- binomial coefficient (Z13848): Description missing
- k-permutation (Z13854): Description missing
- sign (a-b)*(a-c) (Z16762): returns the sign of the (natural number) calculation (a-b)*(a-c)
- 2*n+1 (Z15108): Description missing
- Ackermann function (two-argument version) (Z14742): Description missing
- Delannoy number, python (Z14860): Description missing
- Entringer number (Z15318): E(n,k)
- Eulerian number (Z14894): A(n,k)
- Fuss–Catalan number (Z15341): A_m(p,r)
- Lah number (Z14900): Description missing
- Lobb number (Z14905): L(m,n) with n ≥ m ≥ 0
- Narayana number (Z14847): N(n,k)
- Padovan number (Z15075): Description missing
- Padovan's spiral number (Z15085): Description missing
- natural number range (Z13831): Get a list of natural numbers spanning a given range
Natural number sequences and unary natural number functions
- is Armstrong number (Z12636): Sum of individual digit to the power total number of digits is equal to original number.
- Collatz conjecture function (Z13561): returns the next entry in the Collatz sequence whose first entry is the input
- total stopping time (Collatz function) (Z14058): number of iterations of the Collatz function before the input reaches 1
- stopping time (Collatz function) (Z14066): iterations before the hailstone number goes below it's initial value (a_i < a_0), or reaches 1. See Z14058 for the total stopping time.
- Catalan number (Z13857): Description missing
- Cullen number (Z15044): Description missing
- Dedekind psi function (Z13957): Description missing
- Euler totient function (Z13955): Description missing
- Euler zigzag number (Z15302): Description missing
- Fermat number, F_n = 2^2^n + 1 (Z14629): Description missing
- Hooley's delta function (Z14917): Description missing
- Hurwitz-Radon number (Z15119): Description missing
- McCarthy 91 function (Z15232): Description missing
- Motzkin number (Z14871): Description missing
- Padovan number (Z15075): Description missing
- Padovan's spiral number (Z15085): Description missing
- Perrin number (Z15080): Description missing
- Riordan number (Z15061): a(n) = (n-1)*(2*a(n-1) + 3*a(n-2))/(n+1)
- Schröder number (Z14876): Description missing
- Sylvester's sequence nth term (Z13843): Description missing
- Wedderburn–Etherington number (Z15386): Description missing
- Woodall number (Z15047): Description missing
- cake number (Z14888): Description missing
- central Delannoy number (Z14864): Description missing
- central binomial coefficient (Z13989): Description missing
- exponential factorial (Z15157): Description missing
- largest prime divisor (Z13735): Description missing
Bitwise Functions
- bitwise and (Z13651): Returns 1 in bit position where both bits are 1, otherwise returns 0.
- bitwise or (Z13652): Description missing
- bitwise xor (Z13653): Description missing
- left shift (Z13812): Description missing
- right shift (Z13813): Description missing
- binary weight of n (Z13860): number of 1's in the binary representation of n
- length of binary representation (Z13928): Description missing
Number conversions
By base
- Binary to decimal (Z12982): Takes a binary number set and returns the equivalent decimal number.
- Binary to hexadecimal (Z12987): Takes a binary number set and returns the equivalent Hexadecimal number.
- natural number to binary string (without prefix) (Z13779): Description missing
- natural number to octal (without prefix) (Z13780): Converts a decimal (base 10) integer to octal (base 8) (given as a string) without the "0o" prefix
- natural number to hexadecimal (lowercase, without prefix) (Z13781): Description missing
- natural number to base n (Z15671): base n <= 36
- natural number to binary (with prefix) (Z13782): Description missing
- natural number to octal (with prefix) (Z13783): Converts a decimal (base-10) integer to octal (base-8) as a string, prefixed with "0o"
- natural number to hexadecimal (lowercase, with prefix) (Z13784): Description missing
- binary string to natural number (Z13797): Description missing
- octal to natural number (Z13798): Converts an octal (base 8) (given as a string) to natural number
- hexadecimal to natural number (Z13799): Description missing
- base n to natural number (Z13806): Converts an integer (given as a string, with base n <= 36) in the given base to a natural number
- List of digits in base n (Z31177): Takes a natural number and a base, and creates a list of digits (as natural numbers, as eventually you will run out of symbols) representing the original base 10 number in that base.
By system
- Boolean to natural number (Z17065): Converts a Boolean to a natural number
- Arabic to Roman numeral (Z11022): Convert a Arabic numeral to Roman numeral [1, 3999]).
- Roman to Arabic numeral (Z11023): Convert a Roman numeral to Arabic numeral
- Attic numerals to Natural number (Z18515): Description missing
- Arabic to Indo-Arabic numerals (Z18489): Takes an Arabic number and returns the same number in the Indo-Arabic system.
- Indo-Arabic to Arabic numerals (Z18504): Takes an Indo-Arabic number and returns the same number in the Arabic system.
- Arabic to Glagolitic numeral (Z14018): Convert a Arabic numeral to Glagolitic numeral [1, 5999].
- Devanagari numerals to Arabic numerals (Z22294): Converts any Devanagari numerals in the string to Arabic numerals. Reverse at Z22649
- Arabic numerals to Devanagari numerals (Z22649): Converts any Arabic numerals in string to Devanagari numerals. Reverse at Z22294
- Thai numerals to Arabic numerals (Z22285): converts any Thai numerals in the string to Arabic numerals
- Burmese numerals to Arabic numerals (Z22288): converts any Burmese numerals in the string to Arabic numerals
- Bengali numerals to Arabic numerals (Z22291): converts any Bengali numerals in the string to Arabic numerals
Other
Integer functions
| make Integer (Z33745) | Z16683K1: Sign (Z16659) | sign of integer (Z17105) |
|---|---|---|
| Z16683K2: Natural number (Z13518) | absolute value of integer as natural number (Z17144) |
- same Integer (Z16688): Returns true if the integers are identical
- integers have the same sign (Z17249): true if the two integers have the same sign
- integers have the same absolute magnitude (Z17254): True if the absolute value of the inputs are equivalent
- negate integer (Z17186): returns the negative of the given integer
- increment integer (Z17153): returns the value one higher than the input integer
- decrement integer (Z17160): return the value one lower than the input value
- add Integers (Z16693): adds 2 integers
- subtract an Integer (Z17111): subtracts one integer from another to give the difference as an integer
- multiply Integers (Z17120): returns the first integer times the second integer
- unit integer sign of integer (Z15844): returns 1 if the number is positive, -1 if it is negative, and 0 if it is zero
- sign of integer (Z17105): returns negative/neutral/positive
- is positive integer (Z17204): returns true if an integer is positive (not including 0)
- is zero (integer) (Z17239): true only if the integer is 0
- is even (integer) (Z12480): Returns true if an integer is even and false otherwise. See Z13555 for the natural number version.
- is odd (integer) (Z12429): Returns true if a number is odd and false otherwise
- is negative integer (Z17215): Checks if an integer is negative. Zero is not negative.
- is non-negative integer (Z17229): returns true if the input is either a positive integer or zero
- greater than (integer) (Z17132): True if the first input is greater than the second input
- greater than or equal (integer) (Z17173): returns true if the first integer is greater than or equal to the second
- less than (integer) (Z17140): true if the first integer is less than the second
- less than or equal (integer) (Z17363): Whether the first integer is less than or equal to the second integer.
- display Integer (Z16700):
- sign to unit integer (Z17151): Description missing
- absolute value of integer (Z17128): returns an integer
- natural number to integer (Z17101): Description missing
- negate natural number to integer (Z17267): Description missing
- absolute value of integer as natural number (Z17144): Returns the absolute value of the input as a natural number
- integer modulo another integer (Z17167): sign of result matches sign of modulus
- are Integers congruent modulo other Integer? (Z32261): Description missing
- natural number exponentiation of integers (Z17263): raises an integer to the power of a natural number
- greater of two integers (Z17376): returns the greater of the two arguments
- lesser of two integers (Z17380): returns the smaller of two integers
| 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 represented by ordered pair of natural numbers (Z17307)
- ordered pair of natural numbers representing integer (Z17301)
- are equivalent ordered pairs representing integers (Z17321)
- negate ordered pair of natural numbers representing integer (Z17326)
- less than (ordered pairs of natural numbers representing integers) (Z17330)
- add integers (represented by an ordered pair of natural numbers) (Z17340)
- subtract integers (represented by an ordered pair of natural numbers) (Z17469)
- multiply integers (represented by an ordered pair of natural numbers) (Z17345)
Integer sequence and unary integer functions
Search for
Functions expecting or returning an explicit Integer object, singly or in a list
Rational number functions
Comparison
- same Rational number (Z19686): Rational numbers that simplify to the same value are considered to be the same, e.g. 1/2=2/4
- same rational within tolerance (Z24506): Checks if the two rationals have the absolute value of their difference less or equal to the error
- Greater than (rational numbers) (Z19751): Description missing
- Greater than or equal to (rational numbers) (Z19752): Description missing
- less than (rational numbers) (Z19753): Description missing
- less than or equal to (rational numbers) (Z19754): Description missing
- is rational in range (inclusive) (Z24403): Description missing
- is rational number an integer (Z19806): returns true if a rational number is equivalent to an integer
Properties
- is unit fraction (Z20065): returns true if a (simplified) rational number is a positive fraction with 1 in the numerator
- is positive rational number (Z21702): Description missing
- Is rational number 0 (Z19922): Special case, because zero can be many different values
- is negative rational number (Z21714): Description missing
- is non-negative rational number (Z21721): Description missing
- is this rational number valid? (Z19583): returns true if the keys in the input value constitute a valid rational number, false otherwise
- digits in denominator of unsimplified rational (Z25642): returns the number of digits in the (unsimplified) denominator of the supplied rational number
Transformation and conversion
- negate rational number (Z19694): Negates a rational number
- multiplicative inverse of Rational number (Z19711): Description missing
- sign of rational number (Z19717): we need to decide whether this should be the simplified or unsimplified rational
- numerator of simplified rational number (Z19722): returns the numerator of the rational number when simplified
- numerator of unsimplified rational number (Z19733): Returns the numerator of the input rational number, without simplification, without sign. Code implementations will not work since rationals are simplified on their way in or out of code.
- denominator of simplified rational number (Z19724): Description missing
- Integer as Rational number (Z19744): return the rational representation of an integer
- rational from integer numerator and denominator (Z19848): Description missing
- rational from sign and natural numbers (Z20584): Description missing
- rational from two natural numbers (Z27232): Description missing
- generate list of powers of q from 0 to n (Z24382): Description missing
- rational as plain decimal to decimal places (Z25445): conventions: Arabic digits, "-" negative, "." radix, no exponential notation, rounds to nearest with even tiebreak, 0 decimal places no radix shown
- display rational as formatted decimal inferring sf (Z25656): a version of Z25362 which infers the length of the string from the significant figures in the (unsimplified) rational itself
- rational as formatted decimal (comma separators) (Z25636): full minus sign, comma separators for groups of three when >4 pre-radix digits, period radix
- rational as formatted decimal (nbsp separators) (Z25639): full minus sign, non-breaking space separators for groups of three when >4 pre-radix digits, comma radix
- rational as formatted decimal (dot separators) (Z29116): Display rational number in decimal format, separated by dot for thousands and comma for decimal
- decimal exponent in unrounded scientific notation (Z27737): Description missing
Rounding
| 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 | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| .# → ±∞ | — | — | |||||||||||
.# → 0truncQ1080547 |
(q) → q — |
— | |||||||||||
| (q) → z Z19682 |
-1 | 0 0 |
0 | 0 0 |
0 | 0 0 |
0 | 0 0 |
0 | 1 1 |
1 | ||
fracQ2366982 |
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 | |
.# → +∞ceilQ12718884 |
(q) → q — |
— | |||||||||||
| (q) → z Z20053 |
0 | -1 0 |
0 | 0 0 |
0 | 0 0 |
1 | 1 1 |
1 | 1 1 |
2 | ||
.# → −∞floorQ56860783 |
(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
- add rational numbers (Z19679): returns the sum of two rational numbers
- subtract rational numbers (Z19699): returns the difference between two rational numbers
- multiply rational numbers (Z19706): Description missing
- divide rational numbers (Z19708): Description missing
- power of rational number (Z21320): returns the rational number taken to the given power
- square of rational number (Z24487): Description missing
- truncate Rational number (Z19682): returns the first integer coming from the rational number towards zero
- floor of rational number (Z20032): returns the floor of a rational number
- ceiling of rational number (Z20053): returns the ceiling of a rational number
- highest of list of Rational numbers (Z31523): Description missing
- lowest of list of Rational numbers (Z31522): Description missing
- limit denominator (Z19800): returns the closest rational number to the input with a denominator no greater than the specified maximum (see https://github.com/python/cpython/issues/95723)
- round rational to fixed decimal places, simplified (Z27705): Rounds to the nearest multiple of 1/10**ndigits. If ndigits is negative rounds half toward even. May return a simplified value, so code implementations are permitted. Unsimplified at Z27719.
- round rational to fix decimal places, unsimplified (Z27719): Rounds to the nearest multiple of 1/10**ndigits. If ndigits is negative rounds half toward even. Returns an unsimplified value.
- nearest rational with specified denominator (Z19814): Returns the rational number with a specified denominator (or a factor of it) nearest to the original rational number. Tiebreaks should round consistently (commercial rounding).
- rational to nearest integer, even integer tiebreak (Z19841): exact halves round to the nearest even integer
- Round to decimal places (string) (Z12606): Rounds a given floating-point number to a whole number of decimal places.
- multiply rational by natural number (Z19826): Description missing
- average of two rationals (Z19833): returns the rational number that is the average of the two inputs
- percent of date range completed (Z20856): Returns the percent (as a rational number) of days completed for a given date and date range.
- volume of a rectangular prism (Rational numbers) (Z20863): The volume of a rectangular prism with a specified length, width, and depth
- volume of a pyramid (Z20870): the volume of a pyramid with a given base length, base width, and height
- area of a rectangle (Z20877): the area of a rectangle with given length and width
- square root of rational as rational (Z24081): Returns an exact rational square root if possible. Leniently accepts inputs with an irrational square root, and returns a rational version of the best floating point approximation.
- square root of rational to float64 (Z20902): returns the square root of a rational number as a float
- absolute value of rational number (Z21692): Description missing
- partial sum of series from k=0 (rational) (Z23899): Adds the terms 0 through n of a series with terms defined by a univariate function of a natural number k. Returns a rational number.
- partial sum of series from k=1 (rational) (Z23882): Adds the terms 1 through n of a series with terms defined by a univariate function of a natural number k. Returns a rational number.
- partial sum of power series (Z24372): adds terms of the form a_n(x-c)^n from n=0 to N, given a numeric function (with any numeric object return) to evaluate a_n
- partial sum of zero-centred power series (Z24374): adds terms of the form a_n(x)^n from n=0 to N
- return +1/1 (Z24376): given any natural number, this function always returns a rational value of +1/1
Operations with custom precision
- square root of rational with precision (Z24505): Calculates the square root of a rational number within the given error. If the rational is a perfect square, returns the exact value.
- exponentiate rationals within error (Z24681): Description missing
- exponential of rational with error (Z24698): Calculates e^x within specified error.
Probability Operations
- complementary probability (Z19967): probability of the event not occurring, given the probability that it will occur. P(!A) = 1 - P(A)
- Bayes' theorem conditional probability P(A|B) (Z20000): The probability of A occurring given that B is known to have occurred. Given by Bayes' theorem: P(A|B) = P(A)*P(B|A)/P(B)
- probability of union (Z20226): probability that either A or B or both occur(s): P(A∪B) = P(A) + P(B) – P(A∩B)
Probability mass functions
- Bernoulli probability mass function (Z21294): Given the probability of success, outputs the probability of the given number of successes occurring in a trial
- Binomial probability mass function (Z20094): the probability of m outcomes out of n trials when each independent trial has a fixed probability (third parameter, here labelled theta) of that outcome
- Geometric probability mass function (Z21312): Given the probability of success and a number of failed trials, outputs the probability of seeing exactly many failures before success.
Floating point functions
| — | 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
- signum of float64 as Sign (Z35303): returns the logical sign i.e. direction from 0, so both zeroes (and NaNs) are neutral; for sign bit, see Z21136
- exponent of floating point number (Z21139): returns the integer exponent key of a float64 number
- significand of floating point number (Z21142): returns the significant key of a float64 number
- special value of floating point (Z21145): returns the special value key of a float64 number
- is zero (float64) (Z22636): Description missing
- is negative (float64) (Z33615): true if the supplied float64 is negative
- is float64 finite? (Z34827): Description missing
Conversions
- Rational number as float (Z20854): Takes a rational number and converts it to a float.
- display float64 as hex string (Z21148): Examples in https://en.wikipedia.org/wiki/Double-precision_floating-point_format#Double-precision_examples
- string to float64 (Python conventions) (Z20915): converts any string that Python can evaluate within float()
- read floating point number leniently (Z21642): takes the user's input string and converts it to a Float64 typed object
- read float64 (Z21925): reading function for float64 with a language specified
- convert biased exponent bits to integer exponent (Z21163): To help understand the raw binary exponent of a float64. Converts the 11-bit string to a number, then subtracts the bias of 1023.
- float as string (JS conventions) (Z20844): following to JS's JSON.stringify behaviour
- convert decimal string from comma to point (Z21679): takes an unseparated string of decimal digits, and converts (all) comma(s) to decimal points
- natural number to float64 (Z20936): converts a natural number value into a float64 value
- integer to float64 (Z20937): Description missing
- float as rational (Z21071): Description missing
- convert (float) (Z21070): it is recommended that you use Z21053 instead of this one. only use this one if needed
Comparisons
- same float64 (Z20850): Check whether two float64 are indistinguishable in code. For the more lenient IEEE 754 equality rule see Z20924. For the even stricter exact object equality, see Z24582.
- float64 equality (Z20924): check equality based on IEEE 754 rule (not to be confused with Z20850)
- less than (float64) (Z20940): Description missing
- less than or equal to (float64) (Z20941): Description missing
- greater than (float64) (Z20943): Description missing
- greater than or equal to (float64) (Z20944): Description missing
- not equal to (float64) (Z20945): Description missing
Rounding
| -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 | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| .# → ±∞ | — | — | ||||||||||||||
.# → 0truncQ1080547 |
(f) → f — |
— | ||||||||||||||
| (f) → z Z21534 |
Content error | -1 | -1 | 0 | 0 | 0 | 0 0 |
0 | 0 | 0 | 1 | 1 | Content error | Content error | ||
fracQ2366982 |
— | — | ||||||||||||||
.# → +∞ceilQ12718884 |
(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 — |
— | |||||||||||||||
.# → −∞floorQ56860783 |
(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
- add (float64) (Z20849): Description missing
- subtract (float64) (Z21031): Description missing
- multiply (float64) (Z21032): Description missing
- divide (float64) (Z21033): Description missing
- sine (float64, rad) (Z16463): Finds the sine of an angle in radians
- cosine (Z12473): Returns the cosine of a angle in radians
- tangent (float64) (Z16475): Finds the tangent of an angle in radians
- cotangent (float64) (Z20954): Description missing
- secant in radians (Z20955): Returns the secant in radians. It is defined as the reciprocal of the cosine function.
- cosecant (Z20956): Description missing
- inverse sine (Z12505): Returns the arcsine of a number
- inverse cosine (Z12497): Returns the arccosine of a number
- arctangent (Z20959): Description missing
- arccotangent (Z20960): Description missing
- arcsecant (Z20961): Description missing
- arccosecant (Z20962): Description missing
- hyperbolic sine (Z20963): Description missing
- hyperbolic cosine (Z20964): Description missing
- hyperbolic tangent (Z20965): Description missing
- hyperbolic cotangent (Z20966): Description missing
- hyperbolic secant (Z20967): Description missing
- hyperbolic cosecant (Z20968): Description missing
- inverse hyperbolic sine (Z12509): Returns the inverse hyperbolic sine of a number
- inverse hyperbolic cosine (Z12500): Returns the inverse hyperbolic cosine of a number
- inverse hyperbolic tangent (Z20971): result in radians
- inverse hyperbolic cotangent (Z20972): Description missing
- inverse hyperbolic secant (Z20973): Description missing
- inverse hyperbolic cosecant (Z20974): Description missing
- float as percent (Z21000): takes a float representing a probability and returns a percent. rounds to the tenths place
- float64 exponentiation base e (Z21001): Description missing
- natural logarithm (float64) (Z21003): Description missing
- float64 logarithm base 2 (Z21004): Description missing
- float64 logarithm base 10 (Z21005): Description missing
- float64 logarithm base 10 (Z21005): Description missing
- float64 erf (Gauss error function) (Z21007): Description missing
- float64 erfc (complementary error function) (Z21008): Description missing
- gamma function (float64) (Z21009): Description missing
- log gamma (Z21010): Description missing
- radians to degrees (Z21012): Description missing
- degrees to radians (float64) (Z21013): convert an angle from degrees to radians
- Rotate a 2D point about origin (Z29125): Rotate a 2D point counterclockwise in Cartesian coordinate
- exponentiation (float64) (Z21028): raises the first argument to the power of the second
- logarithm with arbitrary base (float64) (Z21037): Description missing
- absolute value (float64) (Z21041): Description missing
- signum (float64) (Z34780): returns -1.0, 0.0, or 1.0 for negative finite, zero, and positive finite values respectively
- floor (float64 to integer) (Z20841): Description missing
- ceiling (float64 to float64) (Z21043): rounds towards +∞ i.e. returns the smallest integral value ≥ x
- round to decimal places (float64) (Z21047): rounds a float to n decimal places, where 0 is whole
- negate (float64) (Z21775): negates a floating point number
- pi approximation from Chudnovsky partial sum (f64) (Z23902): returns a float64 approximation to pi based on a limited number of terms in the Chudnovsky algorithm.
- real (float64) number range (Z31079): Get a list of decimal numbers spanning a given range with a chosen fidelity
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
| 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
- complex128 from real and imaginary parts (Z33227): Description missing
- complex128 from magnitude and angle (Z33304): angle in radians, measured CCW (from the +Re axis towards +Im)
- real part (Z33214): Description missing
- imaginary part (Z33221): Description missing
- magnitude of complex128 (Z33499): Description missing
- argument of Complex number (Z33610): returns the angle (radians) from the real axis to the point in complex space
Comparison
Arithmetics
- add complex128s (Z33201): Description missing
- subtract complex128 (Z33366): Description missing
- multiply Complex numbers (float64) (Z33700): Description missing
- divide Complex numbers (float64) (Z33708): Description missing
- negate complex128 (Z33372): Description missing
- complex conjugate (complex128s) (Z33679): Returns a complex number containing the conjugate of a complex number input.
- base-e exponentiation (complex128) (Z35314): Description missing
- sign (normal) of complex128 (Z35312): uses the "normalising" definition: z/abs(z), with the special case sgn(0) = 0, matching the reals
Number operations requiring type conversion
Numeric Characteristics
Arithmetic Functions
- (!) absolute value (numeric string) (Z11235): Returns the absolute value of a number. Keep using string types until floating point numbers are available.
- (!) division of numeric strings (Z12522): see Z13546 for natural number division
- (!) modulo - string types (Z12476): returns the remainder from division, see Z13551 for natural number type
- (!) multiply two numeric strings (full stop input/output format) (Z10862): Multiplies two numbers together into a product, see Z13539 for natural number type
- (!) sum list of numerical strings (Z12720): sum of an arbitrarily sized list of numerical strings
Trigonometric Functions
- inverse cosine (Z12497): Returns the arccosine of a number
- inverse hyperbolic cosine (Z12500): Returns the inverse hyperbolic cosine of a number
- inverse sine (Z12505): Returns the arcsine of a number
- inverse hyperbolic sine (Z12509): Returns the inverse hyperbolic sine of a number
- cosine (Z12473): Returns the cosine of a angle in radians
- Distance between two points on Earth (SI-unit output in meters) (Z14446): Calculates the shortest distance between two points on Earth's surface, given their latitude and longitude coordinates, using the Haversine formula. Assumes Earth is a sphere (an approximation) rather than an oblate
Health Functions
Geometric Functions
Climate related functions
These would benefit from a float type.
- carbon dioxide emissions of journey (Z18421): Outputs kilogram of carbon dioxide equivalents (kg CO2e) based on 2 inputs.
- (!) carbon dioxide emissions of MK1 diesel car journey (Z18391): Takes liter of fuel as input and outputs kilogram of carbon dioxide equivalents (kg CO2e)
- (!) carbon dioxide emissions of MK1 petrol car journey (Z18364): Takes liter of fuel as input and outputs kilogram of carbon dioxide equivalents (kg CO2e)
- (!) carbon dioxide emissions of ethanol E85 car journey (Z18406): Takes liter of fuel as input and outputs kilogram of carbon dioxide equivalents (kg CO2e), see Q57084901
- (!) carbon dioxide emissions of biogas (CNG) car journey (Z18409): Takes kg of gas as input and outputs kilogram of carbon dioxide equivalents (kg CO2e)
- (!) carbon dioxide emissions of electric car journey (Sweden) (Z18412): Takes kWh as input and outputs kilogram of carbon dioxide equivalents (kg CO2e)
- (!) carbon dioxide emissions of fatty acid methyl ester car journey (Z18415): Takes liter of fuel as input and outputs kilogram of carbon dioxide equivalents (kg CO2e)
- (!) carbon dioxide emissions of HVO car journey (Z18418): Takes liter of fuel as input and outputs kilogram of carbon dioxide equivalents (kg CO2e)
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.