|
Numerical Type Constants
Each simple numerical type is intended for a certain type of tasks and allows optimizing the operation of a mql5-program when used correctly. For a better code readability and correct handling of calculation results, there are constants which allow to receive information about restrictions set to a certain type of simple data.
Constant |
Description |
Value |
---|---|---|
CHAR_MIN |
Minimal value, which can be represented by char type |
-128 |
CHAR_MAX |
Maximal value, which can be represented by char type |
127 |
UCHAR_MAX |
Maximal value, which can be represented by uchar type |
255 |
SHORT_MIN |
Minimal value, which can be represented by short type |
-32768 |
SHORT_MAX |
Maximal value, which can be represented by short type |
32767 |
USHORT_MAX |
Maximal value, which can be represented by ushort type |
65535 |
INT_MIN |
Minimal value, which can be represented by int type |
-2147483648 |
INT_MAX |
Maximal value, which can be represented by int type |
2147483647 |
UINT_MAX |
Maximal value, which can be represented by uint type |
4294967295 |
LONG_MIN |
Minimal value, which can be represented by long type |
-9223372036854775808 |
LONG_MAX |
Maximal value, which can be represented by long type |
9223372036854775807 |
ULONG_MAX |
Maximal value, which can be represented by ulong type |
18446744073709551615 |
DBL_MIN |
Minimal positive value, which can be represented by double type |
2.2250738585072014e-308 |
DBL_MAX |
Maximal value, which can be represented by double type |
1.7976931348623158e+308 |
DBL_EPSILON |
Minimal value, which satisfies the condition: 1.0+DBL_EPSILON != 1.0 (for double type) |
2.2204460492503131e-016 |
DBL_DIG |
Number of significant decimal digits for double type |
15 |
DBL_MANT_DIG |
Number of bits in a mantissa for double type |
53 |
DBL_MAX_10_EXP |
Maximal decimal value of exponent degree for double type |
308 |
DBL_MAX_EXP |
Maximal binary value of exponent degree for double type |
1024 |
DBL_MIN_10_EXP |
Minimal decimal value of exponent degree for double type |
(-307) |
DBL_MIN_EXP |
Minimal binary value of exponent degree for double type |
(-1021) |
FLT_MIN |
Minimal positive value, which can be represented by float type |
1.175494351e-38 |
FLT_MAX |
Maximal value, which can be represented by float type |
3.402823466e+38 |
FLT_EPSILON |
Minimal value, which satisfies the condition: 1.0+DBL_EPSILON != 1.0 (for float type) |
1.192092896e–07 |
FLT_DIG |
Number of significant decimal digits for float type |
6 |
FLT_MANT_DIG |
Number of bits in a mantissa for float type |
24 |
FLT_MAX_10_EXP |
Maximal decimal value of exponent degree for float type |
38 |
FLT_MAX_EXP |
Maximal binary value of exponent degree for float type |
128 |
FLT_MIN_10_EXP |
Minimal decimal value of exponent degree for float type |
-37 |
FLT_MIN_EXP |
Minimal binary value of exponent degree for float type |
(-125) |
Example:
void OnStart()
|