Skip to content

Latest commit

 

History

History
72 lines (52 loc) · 2.62 KB

cos-cosf-cosl.md

File metadata and controls

72 lines (52 loc) · 2.62 KB
titledescriptionms.dateapi_nameapi_locationapi_typetopic_typef1_keywordshelpviewer_keywordsms.assetid
cos, cosf, cosl
API reference for cos, cosf, and cosl; which calculate the cosine value of a floating-point number.
08/31/2020
cos
cosf
cosl
_o_cos
_o_cosf
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

doublecos( doublex ); floatcosf( floatx ); long doublecosl( long doublex ); #definecos(X) // Requires C11 or higherfloatcos( floatx ); // C++ onlylong doublecos( long doublex ); // 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.

InputSEH exception_matherr exception
± QNaN, INDnone_DOMAIN
± INFINVALID_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, unless you're using the <tgmath.h> macro to call this function, cos always takes and returns a double.

If you use the <tgmath.h> cos() macro, the type of the argument determines which version of the function is selected. See Type-generic math for details.

By default, this function's global state is scoped to the application. To change this behavior, see Global state in the CRT.

Requirements

RoutineRequired C headerRequired C++ header
cos, cosh, cosf<math.h><cmath> or <math.h>
cos() macro<tgmath.h>

For more compatibility information, see Compatibility.

Example

See the example in sin, sinf, sinl.

See also

Math and floating-point support
acos, acosf, acosl
asin, asinf, asinl
atan, atanf, atanl, atan2, atan2f, atan2l
_matherr
sin, sinf, sinl
tan, tanf, tanl

close