Share c++ math.h source code

phuctam897

New member
## C ++ Math.h Mã nguồn

[Liên kết đến bài viết tham khảo] (https://www.cplusplus.com/reference/cmath/)

Tệp tiêu đề `<Cmath>` chứa một số hàm toán học có thể được sử dụng trong các chương trình C ++.Các chức năng này bao gồm các hàm lượng giác, các hàm logarit, hàm theo cấp số nhân và các hoạt động toán học khác.

Sau đây là danh sách các chức năng được sử dụng phổ biến nhất trong tệp tiêu đề `<cmath>`:

* `sin ()`: Trả về sin của một số.
* `cos ()`: Trả về cosin của một số.
* `tan ()`: Trả về tiếp tuyến của một số.
* `asin ()`: Trả về arcsine của một số.
* `acos ()`: Trả về arccosine của một số.
* `atan ()`: Trả về arctangent của một số.
* `exp ()`: Trả về hàm mũ của một số.
* `log ()`: Trả về logarit tự nhiên của một số.
* `pow ()`: Trả về sức mạnh của một số.

Ngoài các chức năng này, tệp tiêu đề `<cmath>` còn chứa một số hằng số được sử dụng trong các tính toán toán học.Những hằng số này bao gồm `pi`, là hằng số toán học pi và` e`, là hằng số toán học e.

Sau đây là một ví dụ về cách sử dụng tệp tiêu đề `<cmath>` trong chương trình C ++:

`` `C ++
#include <Istream>
#include <Cmath>

int main () {
// Tính hình sin 30 độ.
Double sin = sin (30.0);

// In kết quả vào bảng điều khiển.
std :: cout << "Sin 30 độ là" << sin << std :: endl;

trả lại 0;
}
`` `

## hashtags

* #C ++
* #toán học
* #Programming
* #mã nguồn
* #thẩm quyền giải quyết
=======================================
## C++ Math.h Source Code

[Link to reference article](https://www.cplusplus.com/reference/cmath/)

The `<cmath>` header file contains a number of mathematical functions that can be used in C++ programs. These functions include trigonometric functions, logarithmic functions, exponential functions, and other mathematical operations.

The following is a list of the most commonly used functions in the `<cmath>` header file:

* `sin()`: Returns the sine of a number.
* `cos()`: Returns the cosine of a number.
* `tan()`: Returns the tangent of a number.
* `asin()`: Returns the arcsine of a number.
* `acos()`: Returns the arccosine of a number.
* `atan()`: Returns the arctangent of a number.
* `exp()`: Returns the exponential of a number.
* `log()`: Returns the natural logarithm of a number.
* `pow()`: Returns the power of a number.

In addition to these functions, the `<cmath>` header file also contains a number of constants that are used in mathematical calculations. These constants include `PI`, which is the mathematical constant pi, and `E`, which is the mathematical constant e.

The following is an example of how to use the `<cmath>` header file in a C++ program:

```c++
#include <iostream>
#include <cmath>

int main() {
// Calculate the sine of 30 degrees.
double sine = sin(30.0);

// Print the result to the console.
std::cout << "The sine of 30 degrees is " << sine << std::endl;

return 0;
}
```

## Hashtags

* #C++
* #Math
* #Programming
* #Source code
* #Reference
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top