|
Appendix IV. Operators, functions and constants |
Scroll |
Arithmetic operators
Designation |
Description |
|
() |
statement parentheses |
|
+ |
add, or unary plus |
|
- |
subtract, or unary minus |
|
* |
multiply |
|
/ |
divide |
|
= |
equal |
|
% |
divide integer (left-associative) |
|
^ |
involute (right-associative) |
|
|
•Left associativity of operations: when the operators have equal precedence, the result of the expression is calculated from left to right, i.e., a % b % c = (a % b) % c. •Right associativity of operations: when operator priorities are equal, the result of the expression is calculated right to left, i.e. a^b^c = a^(b^c). |
Designation |
Description |
|
== |
identical |
|
!= |
non-identical |
|
> |
greater than |
|
< |
less than |
|
>= |
greater than or equal to |
|
<= |
less than or equal to |
|
! |
logic negation |
|
&& |
logical AND |
|
|| |
logical OR |
|
?: |
logical expression a ? b : c (if a is true (not equal to 0), then b, otherwise c, where a, b and c can be expressions) |
Designation |
Description |
|
sin |
sine (radian argument); |
|
cos |
cosine in rads |
|
tan |
tangent in rads |
|
atan |
arctangent in rads |
|
acos |
arccosine in rads |
|
asin |
arcsine in rads |
|
sind |
sine in degrees |
|
cosd |
cosine in degrees |
|
tand |
tangent in degrees |
|
atand |
arctangent in degrees |
|
acosd |
arccosine in degrees |
|
asind |
arcsine in degrees |
|
deg |
rads to degrees conversion |
|
rad |
degrees to rads conversion |
|
sqrt |
square root; |
|
exp |
exponent; |
|
ln |
natural logarithm; |
|
lg |
decimal logarithm |
|
abs |
modulus; |
|
ceil |
rounding off to a larger integer; |
|
floor |
rounding off to a smaller integer; |
|
round |
rounding off to a nearest integer; |
Designation |
Value |
Description |
|
M_FI |
1.6180339887499 |
φ is an irrational number of the golden ratio |
|
M_E |
2.71828182845904523536 |
e is the base of the natural logarithm |
|
M_PI |
3.14159265358979323846 |
π is the ratio of the circumference of a circle to its diameter |
|
M_PI_2 |
1.57079632679489661923 |
π/2 |
|
M_PI_4 |
0.785398163397448309616 |
π/4 |
|
M_PI2 |
6.28318530717959 |
2π |
|
M_SQRT2 |
1.41421356237309504880 |
Square Root of 2 |
|
M_RADDEG |
57.29577951308 |
You have to choose or enter recalculation factor from radians to degrees (180/π) |
|
M_DEGRAD |
0.01745329251994 |
You have to choose or enter recalculation factor from degrees to radians (π/180) |
|
FLT_EPS |
1.19209290E-07 |
The difference between two numbers at which these numbers are considered equal |