Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 2.14 KB

cos-cosf-cosl.md

File metadata and controls

68 lines (50 loc) · 2.14 KB
title ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords ms.assetid
cos, cosf, cosl
04/05/2018
cos
cosf
cosl
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-math-l1-1-0.dll
DLLExport
apiref
cos
cosf
cosl
cosines
cosl function
calculating cosine
cosf function
cos function
trigonometric functions
cosines, calculating
ae90435e-6b68-4a47-a81f-be87d5c08f16

cos, cosf, cosl

Calculates the cosine.

Syntax

double cos( double x );
float cosf( float x );
long double cosl( long double x );
float cos( float x );  // C++ only
long double cos( long double x );  // C++ only

Parameters

x
Angle in radians.

Return Value

The cosine of x. If x is greater than or equal to 263, or less than or equal to -263, a loss of significance in the result occurs.

Input SEH Exception Matherr Exception
± QNAN, IND none _DOMAIN
± INF INVALID _DOMAIN

Remarks

Because C++ allows overloading, you can call overloads of cos that take and return float or long double values. In a C program, cos always takes and returns a double.

Requirements

Routine Required C header Required C++ header
cos, cosh, cosf <math.h> <cmath> or <math.h>

For additional compatibility information, see Compatibility.

Example

See the example in sin, sinf, sinl.

See also

Floating-Point Support
acos, acosf, acosl
asin, asinf, asinl
atan, atanf, atanl, atan2, atan2f, atan2l
_matherr
sin, sinf, sinl
tan, tanf, tanl
_CIcos