C++ cmath asin() function
Example
Return the arcsine of different numbers:
cout << asin(0.64);
cout << asin(-0.4);
cout << asin(0);
cout << asin(1);
cout << asin(-1);
cout << asin(2);
Try it Yourself »
Definition and Usage
The asin()
function returns the arcsine of a number in radians.
The asin()
function is defined in the <cmath>
header file.
Syntax
One of the following:
asin(double number);
asin(float number);
Parameter Values
Parameter | Description |
---|---|
number |
Required. A number to find the arcsine of, in the range -1 to 1. If the value is outside -1 to 1, it returns NaN (Not a Number). If the number is an integer type then it will be treated as a double .
|
Technical Details
Returns: | A float value (if the argument is float) or double value (in any other case) representing the arcsine of a number. |
---|