Numeric functions
Rounding, division, base conversion and numeric calculations.
Rounding, division, base conversion and numeric calculations.
bit_count
| Signature | Purpose | Source definition |
|---|---|---|
mysql.bit_count(bigint) → integer | Count the set bits. | SQL |
mysql.bit_count(bytea) → integer | Count the set bits. | SQL |
mysql.bit_count(text) → integer | Count the set bits. | SQL |
ceil
| Signature | Purpose | Source definition |
|---|---|---|
mysql.ceil(text) → bigint | Round up to an integer. | SQL |
ceiling
| Signature | Purpose | Source definition |
|---|---|---|
mysql.ceiling(text) → bigint | Round up to an integer. | SQL |
conv
| Signature | Purpose | Source definition |
|---|---|---|
mysql.conv(bigint, integer, integer) → text | Convert a number between bases. | SQL |
mysql.conv(text, integer, integer) → text | Convert a number between bases. | SQL |
floor
| Signature | Purpose | Source definition |
|---|---|---|
mysql.floor(text) → bigint | Round down to an integer. | SQL |
int_div
| Signature | Purpose | Source definition |
|---|---|---|
mysql.int_div(mysql.hexlit, mysql.hexlit) → bigint | Compute the integer quotient for MySQL DIV. | SQL |
mysql.int_div(mysql.hexlit, numeric) → bigint | Compute the integer quotient for MySQL DIV. | SQL |
mysql.int_div(numeric, mysql.hexlit) → bigint | Compute the integer quotient for MySQL DIV. | SQL |
mysql.int_div(numeric, numeric) → bigint | Compute the integer quotient for MySQL DIV. | SQL |
log
| Signature | Purpose | Source definition |
|---|---|---|
mysql.log(bigint) → numeric | Compute a logarithm. | SQL |
mysql.log(integer) → numeric | Compute a logarithm. | SQL |
mysql.log(numeric) → numeric | Compute a logarithm. | SQL |
mysql.log(smallint) → numeric | Compute a logarithm. | SQL |
log2
| Signature | Purpose | Source definition |
|---|---|---|
mysql.log2(double precision) → numeric | Compute the base-two logarithm. | SQL |
mysql.log2(numeric) → numeric | Compute the base-two logarithm. | SQL |
mod
| Signature | Purpose | Source definition |
|---|---|---|
mysql.mod(bigint, bigint) → bigint | Return the remainder of division. | SQL |
mysql.mod(bigint, text) → numeric | Return the remainder of division. | SQL |
mysql.mod(integer, integer) → integer | Return the remainder of division. | SQL |
mysql.mod(integer, text) → numeric | Return the remainder of division. | SQL |
mysql.mod(mysql."smallint", mysql."smallint") → mysql."smallint" | Return the remainder of division. | SQL |
mysql.mod(mysql."smallint", text) → numeric | Return the remainder of division. | SQL |
mysql.mod(numeric, numeric) → numeric | Return the remainder of division. | SQL |
mysql.mod(numeric, text) → numeric | Return the remainder of division. | SQL |
mysql.mod(text, bigint) → numeric | Return the remainder of division. | SQL |
mysql.mod(text, integer) → numeric | Return the remainder of division. | SQL |
mysql.mod(text, mysql."smallint") → numeric | Return the remainder of division. | SQL |
mysql.mod(text, numeric) → numeric | Return the remainder of division. | SQL |
mysql.mod(text, text) → numeric | Return the remainder of division. | SQL |
rand
| Signature | Purpose | Source definition |
|---|---|---|
mysql.rand() → numeric | Generate a pseudorandom number. | SQL |
mysql.rand(bigint) → numeric | Generate a pseudorandom number. | SQL |
mysql.rand(integer) → numeric | Generate a pseudorandom number. | SQL |
round
| Signature | Purpose | Source definition |
|---|---|---|
mysql.round(integer) → integer | Round to the requested precision. | SQL |
mysql.round(integer, integer) → integer | Round to the requested precision. | SQL |
mysql.round(numeric) → integer | Round to the requested precision. | SQL |
mysql.round(numeric, integer) → numeric | Round to the requested precision. | SQL |
mysql.round(text) → numeric | Round to the requested precision. | SQL |
mysql.round(text, integer) → numeric | Round to the requested precision. | SQL |
sqrt
| Signature | Purpose | Source definition |
|---|---|---|
mysql.sqrt(bigint) → numeric | Compute the square root. | SQL |
mysql.sqrt(integer) → numeric | Compute the square root. | SQL |
mysql.sqrt(numeric) → numeric | Compute the square root. | SQL |
mysql.sqrt(smallint) → numeric | Compute the square root. | SQL |
truncate
| Signature | Purpose | Source definition |
|---|---|---|
mysql.truncate(numeric, integer) → numeric | Truncate a number to the requested decimal place. | SQL |