Get the number of decimal places of any numbers (not just quotes) bypassing Digits() in MQL4 and MQL5 - page 11

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
float is such a ***. these floats are nothing but trouble.
When will they make normal numbers for programming?
You can make a fractional number be stored in memory as an integer and a fractional part.
float is easier, it has less precision (digits after,) than double
are these normal numbers for programming? )))), apparently you want decimal, but alas, the developers have explicitly said (search admin Renat's posts) that there will be no new types
double into fraction, here didhttps://www.mql5.com/ru/forum/290279#comment_9396706
but I still need +, -, *, / to overload operators, so I'm not interested.
float is easier, it has less precision (digits after,) than double
are these normal numbers for programming? )))), apparently you want decimal, but alas, the developers explicitly said (search admin Renat's posts) that there will be no new types
double to fraction, here didhttps://www.mql5.com/ru/forum/290279#comment_9396706
but there still need operators +, -, *, / to overload, so far not interesting abandoned
Yes, DECIMAL.
Or develop your own type. so that the number is stored in memory as its integer part and its fractional part.
like two integers.
2 147 483 647.2 147 483 647
and it would take up as much memory as two integers. 8 bytes.
Yes, DECIMAL.
Or develop your own type to store the number as its integer part and its fractional part.
like two integers.
2 147 483 647.2 147 483 647
And it would take up as much memory as two integers. 8 bytes.
there is already a standard double-double arithmetic
https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format
there is already a standard double-double arithmetic
https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format
Dables store a number in memory in an inaccurate form.
I gave you a video.
I, on the contrary, want to get away from dubles, and you're offering me a duble-duble.
dubles store the number in memory in an inaccurate form.
I gave you a video.
Well, if speed of calculation and compatibility are not important, then yes you can count as you like.
But as soon as these numbers need to be used somewhere - you will have to convert everything back to dable, to an inaccurate number.
Well, if speed and compatibility are not important, then yes, you can count as you like.
But as soon as these numbers need to be used somewhere, you have to convert everything back to a double, inaccurate number.
Well, in decimal, it's OK. They are somehow divided by each other and stored in exact form.
Well, in decimal it's fine. somehow they are divided by each other and stored in exact form.
well, not in decimal, but in fractions
and in decimal you have to accept the same inaccuracy-abbreviations, because it is impossible (unnecessary) to write infinite exact numbers
Well, in decimal it's OK. somehow they're divided by each other and saved in exact form.
I wonder how you'll count logarithms, powers with non-integer numbers, use trigonometry, .... use third-party libraries, indicators... They're all error-prone!
and you're used to where the margin of error might be.
https://www.mql5.com/ru/forum/287618/page3#comment_9240442
This is probably the best solution, but it will be 40% faster (for some reason mql slows down in loops)