LOG10 in JS

Description

Returns the base 10 logarithm of a number (JavaScript LOG10 function Documentation).

Sample Source Pattern

Syntax

Math.log10( expression )

Arguments

expression: Numeric expression. It must be positive, otherwise returns NaN.

Return Type

Same data type sent through parameter as a numeric expression.

Examples

CREATE OR REPLACE FUNCTION compute_log10(argument float)
  RETURNS float
  LANGUAGE JAVASCRIPT
AS
$$
    return Math.log10(ARGUMENT);
$$
;
SELECT COMPUTE_LOG10(7.5);

Last updated