Skip to content

Commit

Permalink
Merge pull request #1230 from ChristianGruen/1216
Browse files Browse the repository at this point in the history
1216 Detailed comments on math:e, sinh(), cosh(), tanh()
  • Loading branch information
ndw authored Jun 5, 2024
2 parents 1fcff20 + f0dc107 commit ad148dc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
59 changes: 29 additions & 30 deletions specifications/xpath-functions-40/src/function-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
<fos:notes>
<p>For <code>xs:float</code> and <code>xs:double</code> operands, floating point division
is performed as specified in <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/>. A positive number divided by
positive zero returns <code>INF</code>. A negative number divided by positive zero
returns <code>-INF</code>. Division by negative zero returns <code>-INF</code> and
Expand Down Expand Up @@ -1052,7 +1052,7 @@ compare($N * $arg2, 0) eq compare($arg1, 0).</eg>
b)*b+(a mod b)</code> = <code>a</code>.
<!--float or double remainder r from a dividend n and a divisor d is defined by the mathematical relation r = n-(d * q) where q is an integer that is negative only if n/d is negative and positive only if n/d is positive, and whose magnitude is as large as possible without exceeding the magnitude of the true mathematical quotient of n and d. -->
Division is truncating division, analogous to integer division, not <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> rounding division i.e. additional digits are truncated,
not rounded to the required precision.</p>
</item>
Expand Down Expand Up @@ -2632,8 +2632,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<fos:example>
<fos:test xslt-version="3.0">
<fos:expression>math:pow(math:e(), 0.05 * 3)</fos:expression>
<fos:result>1.161834242728283e0</fos:result>
<fos:postamble>The amount that results after 3 years at an annual rate of 5%.</fos:postamble>
<fos:result approx="true">1.161834242728283e0</fos:result>
</fos:test>
</fos:example>
</fos:examples>
Expand All @@ -2656,7 +2655,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the mathematical constant <var>e</var> raised to the power of
<code>$value</code>, as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of
the <code>exp</code> function applied to 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -2722,7 +2721,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is ten raised to the power of <code>$value</code>, as defined in the
<bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the <code>exp10</code> function applied
to 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -2784,7 +2783,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the natural logarithm of <code>$value</code>, as defined in the
<bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the <code>log</code> function applied
to 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -2854,7 +2853,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the base-10 logarithm of <code>$value</code>, as defined in the
<bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the <code>log10</code> function applied
to 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -2924,7 +2923,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the mathematical non-negative square root of <code>$value</code>
as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>squareRoot</code> function applied to 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -2999,13 +2998,13 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$x</code> is the empty sequence, the function returns the empty sequence.</p>
<p>If <code>$y</code> is an instance of <code>xs:integer</code>, the result is
<code>$x</code> raised to the power of <code>$y</code> as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the <code>pown</code> function applied to a
64-bit binary floating point value and an integer.</p>
<p>Otherwise <code>$y</code> is converted to an <code>xs:double</code> by numeric
promotion, and the result is <code>$x</code> raised to the power of
<code>$y</code> as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>pow</code> function applied to two 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -3185,7 +3184,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234

<p>Otherwise the result is the sine of <code>$radians</code> (which is treated as an angle in
radians) as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>sin</code> function applied to 64-bit binary floating point values.</p>

Expand Down Expand Up @@ -3262,7 +3261,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
then the result is <code>NaN</code>.</p>
<p>Otherwise the result is the cosine of <code>$radians</code> (which is treated as an angle in
radians) as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>cos</code> function applied to 64-bit binary floating point values.</p>
</fos:rules>
Expand Down Expand Up @@ -3335,7 +3334,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
sequence.</p>
<p>Otherwise the result is the tangent of <code>$radians</code> (which is treated as an angle
in radians) as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>tan</code> function applied to 64-bit binary floating point values.</p>

Expand Down Expand Up @@ -3419,7 +3418,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<fos:rules>
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the arc sine of <code>$value</code> as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>asin</code> function applied to 64-bit binary floating point values.
The result is in the range -<var>π</var>/2 to +<var>π</var>/2 radians. </p>
Expand Down Expand Up @@ -3493,7 +3492,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<fos:rules>
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the arc cosine of <code>$value</code>, as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>acos</code> function applied to 64-bit binary floating point values.
The result is in the range zero to +<var>π</var> radians.</p>
Expand Down Expand Up @@ -3566,7 +3565,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty sequence.</p>
<p>Otherwise the result is the arc tangent of <code>$value</code>, as defined
in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the
<code>atan</code> function applied to 64-bit binary floating point values.
The result is in the range -<var>π</var>/2
Expand Down Expand Up @@ -3636,7 +3635,7 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
</fos:summary>
<fos:rules>
<p>The result is the value of <code>atan2(y, x)</code> as defined in the <bibref
ref="ieee754-2008"
ref="ieee754-2019"
/> specification of the <code>atan2</code> function applied to
64-bit binary floating point values. The result is in the range -<var>π</var>
to +<var>π</var> radians.</p>
Expand Down Expand Up @@ -3721,11 +3720,11 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty
sequence.</p>
<p>Otherwise the result is the hyperbolic sine of <code>$value</code> as defined in the
<bibref ref="ieee754-2008"/> specification of the <code>sinh</code> function applied
<bibref ref="ieee754-2019"/> specification of the <code>sinh</code> function applied
to 64-bit binary floating point values. </p>
</fos:rules>
<fos:notes>
<p>The treatment of the <code>invalidOperation</code> and <code>underflow</code> exceptions
<p>The treatment of the <code>overflow</code> and <code>underflow</code> exceptions
is defined in <specref ref="op.numeric"/>. </p>
<p>If <code>$value</code> is positive or negative zero, the result is
<code>$value</code>.</p>
Expand All @@ -3736,11 +3735,11 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<fos:example>
<fos:test>
<fos:expression>math:sinh(1)</fos:expression>
<fos:result>1.1752011936438014</fos:result>
<fos:result approx="true">1.1752011936438014e0</fos:result>
</fos:test>
<fos:test>
<fos:expression>math:sinh(math:pi())</fos:expression>
<fos:result>11.548739357257748</fos:result>
<fos:result approx="true">11.548739357257748e0</fos:result>
</fos:test>
</fos:example>
</fos:examples>
Expand All @@ -3763,11 +3762,11 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty
sequence.</p>
<p>Otherwise the result is the hyperbolic cosine of <code>$value</code> as defined in the
<bibref ref="ieee754-2008"/> specification of the <code>cosh</code> function applied
<bibref ref="ieee754-2019"/> specification of the <code>cosh</code> function applied
to 64-bit binary floating point values. </p>
</fos:rules>
<fos:notes>
<p>The treatment of the <code>invalidOperation</code> and <code>underflow</code> exceptions
<p>The treatment of the <code>overflow</code> exception
is defined in <specref ref="op.numeric"/>. </p>
<p>If <code>$value</code> is positive or negative zero, the result is
<code>1</code>.</p>
Expand All @@ -3782,11 +3781,11 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<fos:example>
<fos:test>
<fos:expression>math:cosh(0)</fos:expression>
<fos:result>1</fos:result>
<fos:result>1.0e0</fos:result>
</fos:test>
<fos:test>
<fos:expression>math:cosh(math:pi())</fos:expression>
<fos:result>11.591953275521519</fos:result>
<fos:result approx="true">11.591953275521519e0</fos:result>
</fos:test>
</fos:example>
</fos:examples>
Expand All @@ -3809,11 +3808,11 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<p>If <code>$value</code> is the empty sequence, the function returns the empty
sequence.</p>
<p>Otherwise the result is the hyperbolic tangent of <code>$value</code> as defined in the
<bibref ref="ieee754-2008"/> specification of the <code>tanh</code> function applied
<bibref ref="ieee754-2019"/> specification of the <code>tanh</code> function applied
to 64-bit binary floating point values. </p>
</fos:rules>
<fos:notes>
<p>The treatment of the <code>invalidOperation</code> and <code>underflow</code> exceptions
<p>The treatment of the <code>underflow</code> exception
is defined in <specref ref="op.numeric"/>. </p>
<p>If <code>$value</code> is positive or negative zero, the result is
<code>$value</code>.</p>
Expand All @@ -3826,11 +3825,11 @@ translate(value := '٢٠٢٣', replace := '٠١٢٣٤٥٦٧٨٩', with := '01234
<fos:example>
<fos:test>
<fos:expression>math:tanh(1)</fos:expression>
<fos:result>0.7615941559557649</fos:result>
<fos:result approx="true">0.7615941559557649e0</fos:result>
</fos:test>
<fos:test>
<fos:expression>math:tanh(math:pi())</fos:expression>
<fos:result>0.99627207622075</fos:result>
<fos:result approx="true">0.99627207622075e0</fos:result>
</fos:test>
</fos:example>
</fos:examples>
Expand Down
Loading

0 comments on commit ad148dc

Please sign in to comment.