exslt-math:constant

Delivers the value of one of the named constants PI, E, SQRRT2, LN2, LN10, LOG2E, SQRT1_2.

constant($name as xs:string, $precision as xs:integer) ➔ xs:double

Arguments

 

$name

xs:string

The constant required

 

$precision

xs:integer

The required precision

Result

xs:double

Namespace

http://exslt.org/math

Links to specifications

EXSLT Math Module

Saxon availability

Requires Saxon-PE or Saxon-EE. Available for Java and C/C++ only (not .NET).

Notes on the Saxon implementation

The implementation starts with a decimal string representation of the constant, truncates this to the required precision, then parses the result as a double.