I'm trying to use MQL5 for some stats & probability calculations but I run into a seemed very basic problem but I cannot find any answers after searches online. When a very large integer number such as 2^100 exceeds the maximum capacity of the long type or even the ulong type the variables could not store the number correctly. What should I do to resolve this issue? Please help!
- long or ulong type variable for magic number?
- Little help please BARS AGO syntax?
- Jamming a very large long into a double
Depending on your required precision.
ulong is 64 bit, the max value is (2 pow 64) - 1
Either you build code to handle two ulong as one, meaning you need to have an upper and lower value, or you opt for float.
Depending on what you need.
| Constant | Description | Value |
| ULONG_MAX | Maximal value, which can be represented by ulong type | 18446744073709551615 |
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register