- Integer Types
- Real Types (double, float)
- Complex number (complex, complexf)
- String Type
- Structures, Classes and Interfaces
- Dynamic Array Object
- Matrices and vectors
- Typecasting
- Void Type and NULL Constant
- User-defined Types
- Object Pointers
- References: Modifier & and Keyword this
Complex number (complex, complexf)
The built-in complex type is a structure with two double fields:
struct complex
|
The built-in complexf type is a structure with two float fields:
struct complexf
|
The complex and complexf types can be passed by value as parameters for MQL5 functions (in contrast to ordinary structures, which are only passed by reference). For functions imported from DLLs, the complex and complexf types must be passed only by reference.
The 'i' suffix is used to describe complex constants:
complex square(complex c)
|
Only simple operations are currently available for complex numbers: =, +, -, *, /, +=, -=, *=, /=, ==,!=.
Support for additional mathematical functions will be added later, enabling the calculation of the absolute value, sine, cosine and others.
vectorc
One-dimensional array of complex type numbers is meant to handle complex numbers. The vector<complex> entry can be used in template functions.
matrixc
Two-dimensional array of complex type numbers is meant to handle complex numbers. The matrix<complex> entry can be used in template functions.
vectorcf
One-dimensional array of complexf type numbers is meant to handle complex numbers. The vector<complexf> entry can be used in template functions.
matrixcf
Two-dimensional array of complexf type numbers is meant to handle complex numbers. The matrix<complexf> entry can be used in template functions.