From bc32d5a6a6a39f3be4f0da1da78ed4798dc54097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gr=C3=BCn?= Date: Mon, 13 May 2024 09:31:00 +0200 Subject: [PATCH] Math Functions: math:e, math:sinh, math:cosh, math:tanh. Closes #1196 --- .../src/function-catalog.xml | 180 ++++++++++++++++-- .../src/xpath-functions.xml | 12 ++ 2 files changed, 180 insertions(+), 12 deletions(-) diff --git a/specifications/xpath-functions-40/src/function-catalog.xml b/specifications/xpath-functions-40/src/function-catalog.xml index 94764e7ce..85512d608 100644 --- a/specifications/xpath-functions-40/src/function-catalog.xml +++ b/specifications/xpath-functions-40/src/function-catalog.xml @@ -2647,6 +2647,32 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234 + + + + + + deterministic + context-independent + focus-independent + + +

Returns an approximation to the mathematical constant e.

+
+ +

This function returns the xs:double value whose lexical representation is + 2.718281828459045e0

+
+ + + + math:pow(math:e(), 0.05 * 3) + 1.161834242728283e0 + The amount that results after 3 years at an annual rate of 5%. + + + +
@@ -3269,7 +3295,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234 sequence.

If $radians is positive or negative infinity, or NaN, then the result is NaN.

-

Otherwise the result is the cosine of $radians (which is treated as an angle in +

Otherwise the result is the cosine of $radians (which is treated as an angle in radians) as defined in the specification of the @@ -3440,9 +3466,9 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234

If $value is positive or negative zero, the result is $value.

If $value is NaN, or if its absolute value is greater than one, then the result is NaN.

-

In other cases the result is an xs:double value representing an angle - θ in radians in the range -π/2 <= - θ <= +π/2.

+

In other cases, the result is an xs:double value representing an angle + θ in radians in the range -math:pi() div 2 <= + θ <= math:pi() div 2.

@@ -3512,9 +3538,9 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234 ref="op.numeric"/>.

If $value is NaN, or if its absolute value is greater than one, then the result is NaN.

-

In other cases the result is an xs:double value representing an angle - θ in radians in the range 0 <= θ <= - +π.

+

In other cases, the result is an xs:double value representing an angle + θ in radians in the range 0 <= θ <= + math:pi().

@@ -3586,9 +3612,9 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234 ref="op.numeric"/>.

If $value is positive or negative zero, the result is $value.

If $value is NaN then the result is NaN.

-

In other cases the result is an xs:double value representing an angle - θ in radians in the range -π/2 <= - θ <= +π/2.

+

In other cases, the result is an xs:double value representing an angle + θ in radians in the range -math:pi() div 2 <= + θ <= math:pi() div 2.

@@ -3668,8 +3694,6 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234 - - math:atan2(+0.0e0, 0.0e0) @@ -3714,6 +3738,138 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
+ + + + + + + + deterministic + context-independent + focus-independent + + +

Returns the hyperbolic sine of the argument.

+
+ +

If $value is the empty sequence, the function returns the empty + sequence.

+

Otherwise the result is the hyperbolic sine of $value as defined in the + specification of the sinh function applied + to 64-bit binary floating point values.

+
+ +

The treatment of the invalidOperation and underflow exceptions + is defined in .

+

If $value is positive or negative zero, the result is + $value.

+

If $value is positive or negative infinity, or NaN, + the result is NaN.

+
+ + + + math:sinh(1) + 1.1752011936438014 + + + math:sinh(math:pi()) + 11.548739357257748 + + + +
+ + + + + + + + deterministic + context-independent + focus-independent + + +

Returns the hyperbolic cosine of the argument.

+
+ +

If $value is the empty sequence, the function returns the empty + sequence.

+

Otherwise the result is the hyperbolic cosine of $value as defined in the + specification of the cosh function applied + to 64-bit binary floating point values.

+
+ +

The treatment of the invalidOperation and underflow exceptions + is defined in .

+

If $value is positive or negative zero, the result is + 1.

+

If $value is positive or negative infinity, + the result is INF.

+

If $value is NaN, + the result is NaN.

+

In other cases, the result is an xs:double in the range + +1.0 to INF.

+
+ + + + math:cosh(0) + 1 + + + math:cosh(math:pi()) + 11.591953275521519 + + + +
+ + + + + + + + deterministic + context-independent + focus-independent + + +

Returns the hyperbolic tangent of the argument.

+
+ +

If $value is the empty sequence, the function returns the empty + sequence.

+

Otherwise the result is the hyperbolic tangent of $value as defined in the + specification of the tanh function applied + to 64-bit binary floating point values.

+
+ +

The treatment of the invalidOperation and underflow exceptions + is defined in .

+

If $value is positive or negative zero, the result is + $value.

+

If $value is positive infinity, the result is +1.0.

+

If $value is negative infinity, the result is -1.0.

+

In other cases, the result is an xs:double in the range + -1.0 to +1.0.

+
+ + + + math:tanh(1) + 0.7615941559557649 + + + math:tanh(math:pi()) + 0.99627207622075 + + + +
diff --git a/specifications/xpath-functions-40/src/xpath-functions.xml b/specifications/xpath-functions-40/src/xpath-functions.xml index 931acb5e1..a7db914d2 100644 --- a/specifications/xpath-functions-40/src/xpath-functions.xml +++ b/specifications/xpath-functions-40/src/xpath-functions.xml @@ -2292,6 +2292,9 @@ string conversion of the number as obtained above, and the appropriate suff + + + @@ -2331,6 +2334,15 @@ string conversion of the number as obtained above, and the appropriate suff + + + + + + + + + Random Numbers