PI in JS

Description

Constant which represents the PI number (approximately 3.141592...) (JavaScript PI Documentation).

Sample Source Pattern

Syntax

Math.PI

Examples

CREATE OR REPLACE FUNCTION circumference(radius float)
  RETURNS float
  LANGUAGE JAVASCRIPT
AS
$$
  function circumference(r){
    return 2 * Math.PI * r;
  }
  return circumference(RADIUS); 
$$
;
SELECT CIRCUMFERENCE(2);

Last updated