fix replace #include with c for language postfix
This commit is contained in:
committed by
Kristofer Koishigawa
parent
4a2b88b16e
commit
b7e98240c8
@ -108,17 +108,20 @@ Give that a run to see what happens, and be sure to play with the operators and
|
|||||||
# Math library
|
# Math library
|
||||||
C provides a math library (`math.h`) that provides multiple useful math functions. As an example, the power of a number can be calculated as:
|
C provides a math library (`math.h`) that provides multiple useful math functions. As an example, the power of a number can be calculated as:
|
||||||
|
|
||||||
```#include<math.h>
|
```c
|
||||||
|
#include<math.h>
|
||||||
int result = pow(2,3) // will result in 2*2*2 or 8
|
int result = pow(2,3) // will result in 2*2*2 or 8
|
||||||
```
|
```
|
||||||
|
|
||||||
Some other (`math.h`) library functions that may prove useful are:
|
Some other (`math.h`) library functions that may prove useful are:
|
||||||
|
|
||||||
```#include <math.h>
|
```c
|
||||||
|
#include <math.h>
|
||||||
double angle = cos(90.00); // Givs us 0.00
|
double angle = cos(90.00); // Givs us 0.00
|
||||||
int result = sqrt(16); // Gives us 4
|
int result = sqrt(16); // Gives us 4
|
||||||
double result = log(10.00) // Gives us 2.30 (note this is ln(10), not log base 10)
|
double result = log(10.00) // Gives us 2.30 (note this is ln(10), not log base 10)
|
||||||
```
|
```
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// C code to illustrate
|
// C code to illustrate
|
||||||
// the use of ceil function.
|
// the use of ceil function.
|
||||||
|
@ -132,7 +132,8 @@ Dê uma corrida para ver o que acontece e não se esqueça de jogar com os opera
|
|||||||
|
|
||||||
C fornece uma biblioteca de matemática ( `math.h` ) que fornece várias funções matemáticas úteis. Por exemplo, o poder de um número pode ser calculado como:
|
C fornece uma biblioteca de matemática ( `math.h` ) que fornece várias funções matemáticas úteis. Por exemplo, o poder de um número pode ser calculado como:
|
||||||
|
|
||||||
```#include<math.h>
|
```c
|
||||||
|
#include<math.h>
|
||||||
int result = pow(2,3) // will result in 2*2*2 or 8
|
int result = pow(2,3) // will result in 2*2*2 or 8
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -132,7 +132,8 @@ Dale una oportunidad para ver qué pasa, y asegúrate de jugar con los operadore
|
|||||||
|
|
||||||
C proporciona una biblioteca matemática ( `math.h` ) que proporciona múltiples funciones matemáticas útiles. Como ejemplo, la potencia de un número se puede calcular como:
|
C proporciona una biblioteca matemática ( `math.h` ) que proporciona múltiples funciones matemáticas útiles. Como ejemplo, la potencia de un número se puede calcular como:
|
||||||
|
|
||||||
```#include<math.h>
|
```c
|
||||||
|
#include<math.h>
|
||||||
int result = pow(2,3) // will result in 2*2*2 or 8
|
int result = pow(2,3) // will result in 2*2*2 or 8
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user