286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * This class contains EXSLT math extension functions. 286N/A * It is accessed by specifying a namespace URI as follows: 286N/A * The documentation for each function has been copied from the relevant 286N/A * EXSLT Implementer page. 286N/A private static String PI =
"3.1415926535897932384626433832795028841971693993751";
286N/A private static String E =
"2.71828182845904523536028747135266249775724709369996";
286N/A private static String SQRRT2 =
"1.41421356237309504880168872420969807856967187537694";
286N/A private static String LN2 =
"0.69314718055994530941723212145817656807550013436025";
286N/A * The math:max function returns the maximum value of the nodes passed as the argument. 286N/A * The maximum value is defined as follows. The node set passed as an argument is sorted 286N/A * in descending order as it would be by xsl:sort with a data type of number. The maximum 286N/A * is the result of converting the string value of the first node in this sorted list to 286N/A * a number using the number function. 286N/A * If the node set is empty, or if the result of converting the string values of any of the 286N/A * nodes to a number is NaN, then NaN is returned. 286N/A * @param nl The NodeList for the node-set to be evaluated. 286N/A * @return the maximum value found, NaN if any node cannot be converted to a number. 286N/A * The math:min function returns the minimum value of the nodes passed as the argument. 286N/A * The minimum value is defined as follows. The node set passed as an argument is sorted 286N/A * in ascending order as it would be by xsl:sort with a data type of number. The minimum 286N/A * is the result of converting the string value of the first node in this sorted list to 286N/A * a number using the number function. 286N/A * If the node set is empty, or if the result of converting the string values of any of 286N/A * the nodes to a number is NaN, then NaN is returned. 286N/A * @param nl The NodeList for the node-set to be evaluated. 286N/A * @return the minimum value found, NaN if any node cannot be converted to a number. 286N/A * The math:highest function returns the nodes in the node set whose value is the maximum 286N/A * value for the node set. The maximum value for the node set is the same as the value as 286N/A * calculated by math:max. A node has this maximum value if the result of converting its 286N/A * string value to a number as if by the number function is equal to the maximum value, 286N/A * where the equality comparison is defined as a numerical comparison using the = operator. 286N/A * If any of the nodes in the node set has a non-numeric value, the math:max function will 286N/A * return NaN. The definition numeric comparisons entails that NaN != NaN. Therefore if any 286N/A * of the nodes in the node set has a non-numeric value, math:highest will return an empty 286N/A * @param nl The NodeList for the node-set to be evaluated. 286N/A * @return node-set with nodes containing the maximum value found, an empty node-set 286N/A * if any node cannot be converted to a number. 286N/A * The math:lowest function returns the nodes in the node set whose value is the minimum value 286N/A * for the node set. The minimum value for the node set is the same as the value as calculated 286N/A * by math:min. A node has this minimum value if the result of converting its string value to 286N/A * a number as if by the number function is equal to the minimum value, where the equality 286N/A * comparison is defined as a numerical comparison using the = operator. 286N/A * If any of the nodes in the node set has a non-numeric value, the math:min function will return 286N/A * NaN. The definition numeric comparisons entails that NaN != NaN. Therefore if any of the nodes 286N/A * in the node set has a non-numeric value, math:lowest will return an empty node set. 286N/A * @param nl The NodeList for the node-set to be evaluated. 286N/A * @return node-set with nodes containing the minimum value found, an empty node-set 286N/A * if any node cannot be converted to a number. 286N/A * The math:abs function returns the absolute value of a number. 286N/A * @return The absolute value of the number 286N/A * The math:acos function returns the arccosine value of a number. 286N/A * @return The arccosine value of the number 286N/A * The math:asin function returns the arcsine value of a number. 286N/A * @return The arcsine value of the number 286N/A * The math:atan function returns the arctangent value of a number. 286N/A * @return The arctangent value of the number 286N/A * The math:atan2 function returns the angle ( in radians ) from the X axis to a point (y,x). 286N/A * @param num1 The X axis value 286N/A * @param num2 The Y axis value 286N/A * @return The angle (in radians) from the X axis to a point (y,x) 286N/A * The math:cos function returns cosine of the passed argument. 286N/A * @return The cosine value of the number 286N/A * The math:exp function returns e (the base of natural logarithms) raised to a power. 286N/A * @return The value of e raised to the given power 286N/A * The math:log function returns the natural logarithm of a number. 286N/A * @return The natural logarithm of the number 286N/A * The math:power function returns the value of a base expression taken to a specified power. 286N/A * @param num2 The power 286N/A * @return The value of the base expression taken to the specified power 286N/A * The math:random function returns a random number from 0 to 1. 286N/A * @return A random double from 0 to 1 286N/A * The math:sin function returns the sine of the number. 286N/A * @return The sine value of the number 286N/A * The math:sqrt function returns the square root of a number. 286N/A * @return The square root of the number 286N/A * The math:tan function returns the tangent of the number passed as an argument. 286N/A * @return The tangent value of the number 286N/A * The math:constant function returns the specified constant to a set precision. 286N/A * The possible constants are: 286N/A * @param name The name of the constant 286N/A * @param precision The precision 286N/A * @return The value of the specified constant to the given precision