Table of contentsAppendices |
4.4 Number FunctionsNumber Functionsnumber number(object?) The number function converts its argument to a number as follows:
If the argument is omitted, it defaults to a node-set with the context node as its only member. NOTE: number sum(node-set) The sum function returns the sum, for each node in the argument node-set, of the result of converting the [string-value] s of the node to a number. number floor(number) The floor function returns the largest (closest to positive infinity) number that is not greater than the argument and that is an integer. number ceiling(number) The ceiling function returns the smallest (closest to negative infinity) number that is not less than the argument and that is an integer. number round(number) The round function returns the number that is closest to the argument and that is an integer. If there are two such numbers, then the one that is closest to positive infinity is returned. If the argument is NaN, then NaN is returned. If the argument is positive infinity, then positive infinity is returned. If the argument is negative infinity, then negative infinity is returned. If the argument is positive zero, then positive zero is returned. If the argument is negative zero, then negative zero is returned. If the argument is less than zero, but greater than or equal to -0.5, then negative zero is returned. NOTE: |