Math.cos()

Signature

double cos (double a)

Domain

action, condition

Description

Returns the trigonometric cosine of an angle. Special cases:
If the argument is NaN or an infinity, then the result is NaN.
A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.

Parameters

NameTypeDescription
adoubleAn angle, in radians.

Returns

TypeDescription
doubleThe cosine of the argument.

Cautions

none

Example


String result = String.valueOfDouble (Math.cos (0.5));

Result is: result contains: "0.8775825618903728"