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

 
Aliaksandr Hryshyn:
Why?

Here's the addendum

void OnStart()
{
 double p = 0.07;
 Print(p);
 Print(log10(p));
}/*******************************************************************/

Result

2018.11.05 10:45:32.678 !00 (GBPJPY,H1) 0.07000000000000001
2018.11.05 10:45:32.678 !00 (GBPJPY,H1) -1.154901959985743
 
Alexey Viktorov:

Here's the addendum

Result

MathAbs(log10(Point()))
Check it out).
 
And let's look for how to stack without an operator + .
 
Aliaksandr Hryshyn:
MathAbs(log10(Point()))
Check this).

Why do I need it? I already know that 0.00001 is printed without distortion. After all, the question of the topic is to determine the number of decimal places of any number, not just _Point . I showed you in which versions your suggestion will not work.

 

As a mental workout, the fractional part should be represented as a natural fraction and do something with the divisor/dividend (find the nearest non-periodic fraction, for example)

telepathically finding out "how many digits the sender gave you" will not help, but it's fun.

 
   double b=3.00000000000000001;
   int i;
   for(i=0; i<16; i++)
    if(fabs(b-NormalizeDouble(b,i))<DBL_EPSILON) break;
   Print(NormalizeDouble(b,i)," : ",i);


 

Come to your senses. This is nonsense that should not even be discussed seriously.

The author simply has a total misunderstanding of the inner workings of double variables.

 
Mesaoria:

Come to your senses. This is nonsense that should not even be discussed seriously.

The author simply has a total misunderstanding of the inner workings of double variables.

I didn't claim to know everything, you'd better tell me what's wrong or show me your variant
 
Mesaoria:

Come to your senses. This is nonsense that should not even be discussed seriously.

The author simply has a total lack of understanding of the inner workings of double variables.

Please enlighten us poor and weak ones.

 

When will the algorithm be finalised? There is a long overdue need to use it.

Reason: