diff -r 000000000000 -r bc8c9a11cbfc docs/reference/language_extensions.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/reference/language_extensions.xml Wed Oct 10 22:58:21 2012 +0100 @@ -0,0 +1,277 @@ + + + + Language Extensions + + + These language extensions are provided in the following namespace URI: + +http://www.juiblex.co.uk/ns/libxexpr + + People using this namespace are encouraged to use the libxexpr namespace + prefix. + + + + Function <pi> + + + Synopsis + + <pi> returns the value of π. + + + + + Arguments + + <pi> takes no arguments. + + + + + Return Values + + <pi> returns the value of π. + + + + + +<libxexpr:pi/> ≅ <float>3.14</float> + + + + + Function <sin> + + + Synopsis + + <sin> computes the sine function. + + + + + Arguments + + <sin> takes one argument: x. If no argument is given, an error + occurs. + + + + + Return Values + + <sin> returns the sine of its argument, given in radians. + If the argument does not evaluate to a finite number, + <sin> returns an indeterminate result. + + + + + +<libxexpr:sin> + <divide> + <libxexpr:pi/> + 2 + </divide> +</libxexpr:sin> --> <float>1</float> + + + + + Function <atan> + + + Synopsis + + <atan> computes the arc tangent function. + + + + + Arguments + + <atan> takes two arguments: x and y. The y argument defaults to + 1. If the x argument is missing, an error occurs. + + + + + Return Values + + <atan> returns the principal value of the arc tangent of its + argument(s) in radians. If either argument is indeterminate, + the result is also indeterminate. + + + + If two arguments are given, <atan> returns the arc tangent of + y/x, using the signs of the two arguments to determine the quadrant + of the result which will be in the range [-π, π]. If both arguments + are 0, the result will also be 0. + + + + If only one argument is given, <atan> returns the arc tangent of + its argument. The result will be in the range [-π/2, π/2]. + + + + + +<libxexpr:atan>1 0</libxexpr:atan> --> <float>0</float> + + + + + Function <exp> + + + Synopsis + + <exp> computes the base-e exponential function. + + + + + Arguments + + <exp> takes zero or one argument: x. + + + + + Return Values + + <exp> returns the value of e (the base of natural logarithms) + raised to the power of its argument (or just e if no argument is + supplied). If the argument does not evaluate to a finite number, + <exp> returns an indeterminate result. + + + + + +<libxexpr:exp>2</libxexpr:exp> ≅ <float>7.389</float> + + + + + Function <log> + + + Synopsis + + <log> computes the natural logarithmic function. + + + + + Arguments + + <log> takes one argument: x. If no argument is given, an error + occurs. + + + + + Return Values + + <log> returns the natural logarithm of its argument. + If the argument does not evaluate to a positive finite number, + <log> returns an indeterminate result. + + + + + +<libxexpr:log> + <libxexpr:exp>2</libxexpr:exp> +</libxexpr:log> --> <float>2</float> + + + + + Function <pow> + + + Synopsis + + <pow> computes the value of its first argument raised to the + power of its second argument. + + + + + Arguments + + <pow> takes two arguments: x and y. If fewer arguments are + given, an error occurs. + + + + + Return Values + + <pow> returns the value of x (its first argument) raised to the + power of y (its second argument). + + + + If x is a finite value less than 0, and y is a finite non-integer, + <pow> returns an indeterminate result. + + + + If the result overflows, <pow> returns an indeterminate result. + + + + If result underflows, and is not representable, 0 is returned. + + + + Except as specified below, if either argument is indeterminate, + the result is also indeterminate. + + + + If x is 1, the result is 1 (even if y is indeterminate). + + + + If y is 0, the result is 1 (even if x is indeterminate). + + + + If x is 0, and y is an odd integer greater than 0, the result is 0. + + + + If x is 0, and y greater than 0 and not an odd integer, the result + is 0. + + + + If x is 0, and y is less than 0, + <pow> returns an indeterminate result. + + + + + + <libxexpr:pow>10 2</libxexpr:pow> --> <float>100</float> + + +