List of mathematical symbols with their JavaScript equivalent.
Of course. Here is the completed table with the added "Python" and "Go" columns.
| Symbol | Name | Since | Example | JavaScript | Python | Go |
|---|---|---|---|---|---|---|
― |
Horizontal bar for division | ~1300 | a / b |
a / b |
a / b |
|
+ |
Plus sign | 1360 | a + b |
a + b |
a + b |
|
- |
Minus sign | 1489 | a - b |
a - b |
a - b |
|
√ |
Radical symbol | 1525 | Math.sqrt(x) |
import math math.sqrt(x) |
import "math" math.Sqrt(x) |
|
(...) |
Parentheses | 1544 | (a + b) |
(a + b) |
(a + b) |
|
= |
Equals | 1557 | // equality a == b // assignment a = b |
# equality a == b # assignment a = b |
// equality a == b // assignment a = b |
|
. |
Decimal separator | 1593 | 1.75 |
1.75 |
1.75 |
|
× |
Multiplication sign | 1618 | a * b |
a * b |
a * b |
|
± |
Plus–minus sign | 1628 | [a - 2, a + 2] |
(a - 2, a + 2) |
[]float64{a - 2, a + 2} |
|
ⁿ√ |
Radical symbol for nth root | 1629 | Math.pow(a, 1/n) |
a ** (1/n) |
import "math" math.Pow(a, 1/n) |
|
< |
Strict inequality less-than | 1631 | a < b |
a < b |
a < b |
|
> |
Strict inequality greater-than | 1631 | a > b |
a > b |
a > b |
|
xʸ |
Superscript notation | 1636 | a ** b |
a ** b |
import "math" math.Pow(a, b) |
|
x |
Use of the letter x for an independent variable or unknown value | 1637 | // declare let x = 0 // usage x // re-assign x = 2 |
# declare & assign x = 0 # usage x # re-assign x = 2 |
// declare var x int = 0 // short declare x := 0 // usage x // re-assign x = 2 |
|
% |
Percent sign | 1650 | n / 100 |
n / 100 |
float64(n) / 100.0 |
|
∞ |
Infinity sign | 1655 | Infinity |
import math math.inf |
import "math" math.Inf(1) |
|
÷ |
Division sign | 1659 | a / b |
a / b |
a / b |
|
≤ |
Unstrict inequality less-than sign | 1670 | a <= b |
a <= b |
a <= b |
|
≥ |
Unstrict inequality greater-than sign | 1670 | a >= b |
a >= b |
a >= b |
|
d |
Differential sign | 1675 | m = (y2 - y1) / (x2 - x1) |
m = (y2 - y1) / (x2 - x1) |
m = (y2 - y1) / (x2 - x1) |
|
∫ |
Integral sign | 1675 | let dx = 1/8 // step size let sum = 0 for (let x=1; x<=8; x += dx) { sum += f(x) * dx } |
dx = 1/8 # step size total = 0 x = 1.0 while x <= 8: total += f(x) * dx x += dx |
dx := 1.0/8.0 // step size var sum float64 = 0 for x:=1.0; x<=8.0; x+=dx { sum += f(x) * dx } |
|
: |
Colon for division | 1684 | a / b |
a / b |
a / b |
|
· |
Middle dot for multiplication | 1698 | a * b |
a * b |
a * b |
|
⁄ |
Division slash | 1718 | a / b |
a / b |
a / b |
|
≠ |
Inequality sign | unknown | a != b |
a != b |
a != b |
|
x' |
Prime symbol for derivative | 1748 | // TODO |
# TODO |
// TODO |
|
Σ |
Summation symbol | 1755 | let sum = 0 for(let i=0; i<=10; i++) { sum += i } |
total = 0 for i in range(11): total += i |
sum := 0 for i:=0; i<=10; i++ { sum += i } |
|
∝ |
Proportionality sign | 1768 | y/x == b/a |
y/x == b/a |
y/x == b/a |
|
∂ |
Partial differential sign | 1770 | // TODO |
# TODO |
// TODO |
|
≡ |
Identity sign | 1801 | a === b |
a == b |
a == b |
|
[x] |
Integral part (aka floor) | 1808 | Math.floor(x) |
import math math.floor(x) |
import "math" math.Floor(x) |
|
! |
Factorial | 1808 | function factorial(n) { if (n == 0) return 1 return n * factorial(n - 1) } |
def factorial(n): if n == 0: return 1 return n * factorial(n-1) |
func factorial(n uint64) uint64 { if n == 0 { return 1 } return n * factorial(n-1) } |
|
Π |
Product symbol | 1812 | let product = 1 for (let x=2; x<=4; x++) { product *= (x + 1) } |
product = 1 for x in range(2, 5): product *= (x + 1) |
product := 1 for x:=2; x<=4; x++ { product *= (x + 1) } |
|
⊂ |
Set subset of | 1817 | // TC39 Proposal a.isSubsetOf(b) |
a = {1, 2} b = {1, 2, 3} a.issubset(b) |
// No built-in set type. // Must be implemented manually. |
|
⊃ |
Set superset of | 1817 | // TC39 Proposal a.isSupersetOf(b) |
a = {1, 2, 3} b = {1, 2} a.issuperset(b) |
// No built-in set type. // Must be implemented manually. |
|
|...| |
Absolute value notation | 1841 | Math.abs(x) |
abs(x) |
import "math" math.Abs(x) |
|
‖...‖ |
Matrix notation | 1843 | // TODO |
# TODO |
// TODO |
|
∩ |
Intersection | 1888 | // TC39 Proposal a.intersection(b) |
a = {1, 2} b = {2, 3} a.intersection(b) |
// No built-in set type. // Must be implemented manually. |
|
∪ |
Union | 1888 | // TC39 Proposal a.union(b) |
a = {1, 2} b = {2, 3} a.union(b) |
// No built-in set type. // Must be implemented manually. |
|
∈ |
Membership sign | 1894 | let b = new Set(...) b.has(a) |
b = { ... } a in b |
// For a map-based set b := make(map[T]struct{}) _, ok := b[a] |
|
{...} |
Curly brackets for set notation | 1895 | new Set([x, y, z]) |
{x, y, z} |
// Using a map s := map[any]struct{}{ x: {}, y: {}, z: {}, } |
|
∃ |
Existential quantifier (there exists) | 1897 | let array = [ ... ] array.some(x => f(x)) |
array = [ ... ] any(f(x) for x in array) |
func exists(arr []T) bool { for _, x := range arr { if f(x) { return true } } return false } |
|
· |
Dot product | 1902 | let sum = 0 for (let i=0; i<a.length; i++) { sum += a[i] * b[i] } |
s = 0 for i in range(len(a)): s += a[i] * b[i] |
var sum T = 0 for i := range a { sum += a[i] * b[i] } |
|
× |
Cross product | 1902 | let a = [x1, y1, z1] let b = [x2, y2, z2] [(a[1]*b[2])-(a[2]*b[1]), (a[2]*b[0])-(a[0]*b[2]), (a[0]*b[1])-(a[1]*b[0])] |
a = [x1, y1, z1] b = [x2, y2, z2] [(a[1]*b[2])-(a[2]*b[1]), (a[2]*b[0])-(a[0]*b[2]), (a[0]*b[1])-(a[1]*b[0])] |
a := []T{x1, y1, z1} b := []T{x2, y2, z2} []T{ a[1]*b[2] - a[2]*b[1], a[2]*b[0] - a[0]*b[2], a[0]*b[1] - a[1]*b[0], } |
|
∨ |
Logical disjunction (aka OR) | 1906 | a || b |
a or b |
a || b |
|
(...) |
Matrix round bracket notation | 1909 | $\begin{pmatrix} a & b & c \ x & y & z \end{pmatrix}$ | [[a, b, c], [x, y, z]] |
[[a, b, c], [x, y, z]] |
[][]T{{a, b, c}, {x, y, z}} |
[...] |
Matrix square bracket notation | 1909 | $\begin{bmatrix} a & b & c \ x & y & z \end{bmatrix}$ | [[a, b, c], [x, y, z]] |
[[a, b, c], [x, y, z]] |
[][]T{{a, b, c}, {x, y, z}} |
∀ |
Universal quantifier (for all) | 1935 | let array = [ ... ] array.every(x => f(x)) |
array = [ ... ] all(f(x) for x in array) |
func forall(arr []T) bool { for _, x := range arr { if !f(x) { return false } } return true } |
|
∅ |
Empty set sign | 1939 | new Set() |
set() |
// Map simulating a set make(map[any]struct{}) |
|
⌊x⌋ |
Greatest integer ≤ x (aka floor) | 1962 | Math.floor(x) |
import math math.floor(x) |
import "math" math.Floor(x) |
|
⌈x⌉ |
Smallest integer ≥ x (aka ceiling) | 1962 | Math.ceil(x) |
import math. math.ceil(x) |
import "math" math.Ceil(x) |