ix = -3 + 4 * 5 - 6; printf (%d \n, ix); | ((-3) + (4*5))-6 == 11 |
ix= -3 + 4 % 5 - 6; printf (%d \n, ix); | (3 + (4%5))-6 == 1 |
ix = -3 * 4 % -6 / 5; printf (%d \n, ix); | ((-3)*4)%(-6)/5 == 0 |
ix = (7 + 6) % 5 / 2; printf (%d \n, ix); | ((13)) % 5 / 2 == 1 |
, , .. . .
-----------------------------------------------------------------------------------------
!!! . :
#define _USE_MATH_DEFINES //
#include < math. h > //
M_PI π.
:
#include <c math > // ++
M_PI :
#ifndef M_PI
#define M_PI 3.14159265358979323846
# endif
(!!! )
double abs(double x) | |
double sin(double x) | ( () ) |
double cos(double x) | ( ) |
double tan(double x) | ( ) |
double log(double x) | |
double log10(double x) | |
double exp(double x) | (ex) |
double pow(double x, double y) | x y (xy) |
int rand() | 0 RAND_MAX (32767) |
void srand(unsigned n) srand(100); // 100!!! srand (time(0)); // .!!! | , n |
double ceil(double x) ceil(2.8) à3.000000 ceil(-2.8) à-2.000000 | , ( double , x) |
int floor(extended x) floor(2.8) à2.000000 floor(-2.8) à-3.000000 | , ( double , x) |
double fmod(double x,double y) | % ( x y) |
double modf(double x, double* y) | r x y ; r + *y x (c ) |
|
|
< limits> <limits.h> CHAR_MIN CHAR_MAX UCHAR_MAX SHRT_MIN SHRT_MAX USHRT_MAX INT_MIN INT_MAX UINT_MAX < float> <float.h> FLT_MIN FLT_MAX DBL_MIN DBL_MAX LDBL_MIN LDBL_MAX | -128 127 255 -32768 32767 65535 -2 147 483 648 2 147 483 647 4 294 967 295 1.17549e-038 3.40282e+038 2.22507e-308 1.79769e+308 2.22507e-308 1.79769e+308 |
< float > < float. h > | |
FLT_RADIX | (2, 16) |
FLT_DIG | float |
FLT_EPSILON | , 1.0+ ≠1.0? float |
FLT_MAX_EXP | n , (FLT _ RADIX n -1) float |
FLT_MAX_10_EXP | n , 10 n float |
FLT_MIN_EXP | n , 10 n float |
FLT_MIN_10_EXP | n , 10 n - float |
DBL_DIG | double |
DBL_EPSILON | , 1.0+ ≠1.0, double |
DBL_MAX_EXP | n , (FLT _ RADIX n -1) double |
DBL_MAX_10_EXP | n , 10 n double |
DBL_MIN_EXP | n , 10 n double |
DBL_MIN_10_EXP | n , 10 n - double |
-----------------------------------------------------------------------------------------