Trigonometric Operations

The trigonometric operations are defined for integers, floats and decimals. If the argument is an integer it is widened to a float before computing the operation. On the other hand if the argument is a decimal it is narrowed to a float before computing the operation. Widening from decimal to float might fail with an exception, since the unbounded decimals have a greater range than floats.

If the argument of a trigonometric operation is outside of its domain then an undefined evaluation error is thrown. Further when the mathematical result exceeds the range of the float then a float overflow evaluation error is thrown. The throwing of an exception is pre-ferred over returning a float with the meaning of not a number (NaN), negative infinite (-Inf) or positive infinite (+Inf).

The following trigonometric operations are recognized in evaluations:
sin(X): [ISO 9.3.2]
Returns the float representation of the sine of X, the argument must be given in radians.
cos(X): [ISO 9.3.3]
Returns the float representation of the cosine of X, the argument must be given in radians.
tan(X): [TC2 9.3.14]
Returns the float representation of the tangent of X, the argument must be given in radians.
asin(X): [TC2 9.3.11]
Returns the float representation of the arcus sine of X, the result is in radians.
acos(X): [TC2 9.3.12]
Returns the float representation of the arcus cosine of X, the result is in radians.
atan(X): [ISO 9.3.4]
Returns the float representation of the arcus tangent of X, the result is in radians.
X ** Y: [ISO 9.3.1]
Returns the float representation of X raised to the power of Y.
exp(X): [ISO 9.3.5]
Returns the float representation of Euler number e raised to the power of X.
log(X): [ISO 9.3.6]
Returns the float representation of the natural logarithm of X.
sqrt(X): [ISO 9.3.7]
Returns the float representation of the square root of X.
pi: [TC2 9.3.15]
Returns the float representation of π.
e:
Returns the float representation of Euler’s number e.
atan2(X, Y): [TC2 9.3.13]
Returns the float representation of the arc tangent of X and Y, the result is in radians.

Comments