Current location - Training Enrollment Network - Mathematics courses - How to directly use the sin function of C language?
How to directly use the sin function of C language?
When writing a program in C language, just add a header file math.h at the beginning.

You can use sin(x) directly. Pay special attention to the fact that x should be an arc system. If it is not an arc system, it needs to be converted into an arc system.

Add header file method: # include

Extended data:

In C language series programs, header files are widely used. Generally speaking, each C++/C program usually consists of a header file and a definition file. As a carrier file containing function and data interface declarations, the header file is mainly used to save the declaration of the program, while the definition file is used to save the implementation of the program.

C standard library is a collection of all standard header files, as well as general function library implementation programs, such as I/O input/output and string control.

Different from COBOL, Fortran, PL/I and other programming languages, the tasks of C language do not contain embedded keywords, so almost all C language programs are created by functions of standard function libraries.

In 1995, the standard appendix 1 (Na 1) approved the addition of three header files (iso646.h, wchar.h and wctype.h) to the C standard function library. The C99 standard adds six header files (complex.h, fenv.h, inttypes.h, stdpool.h, stdint.h and tgmath.h).

Five header files (stdalign.h, stdatomic.h, stdnoreturn.h, threads.h and uchar.h) have been added to the standard C 1 1. At this point, C standard function library ***29 header files.

Common c language function library:

& ltmath.h & gt,& ltstdio.h & gt,& ltstdlib.h & gt,& lttime.h & gt,& ltstring.h & gt。

Usage: # include+;

Baidu encyclopedia -C standard function library