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
Made functions for rounding off the bottom and top once upon a time
Might help someone
Made functions for rounding off the bottom and top once upon a time
Might help someone
try to get a result of0.9999999999999999999
X = 0.99999999999999999
10*X = 10*0.99999999999999999
10*X-X = 10*0.999999999999999-0.9999999999999
9*X = 9*0.99999999999999999
we get 9*X = 9 or X equals 1 (one)
v1 = (1/3) = 0.33333333 | v2 = 3*(1/3) = 1.00000000
or 0.999999999999999 = 1.0
v1 (1.00000000) >= 1.0
Thank you all for the helpful thread!
I've chosen the solution of rounding 1 digit more viaNormalizeDouble, and then trimming the last digit. So far, it's completely suitable.
Again about rounding......
Please advise on the situation (don't throw tomatoes, I'm a humanitarian),
there is such a variable:
double delta=NormalizeDouble(new_lot-sum_lots,Lots_Digits);
if(delta>0) delta-=OrderLots();
if(delta<0) delta+=OrderLots();
The delta is originally normalized,
OrderLots should probably return normalized dubs,
but somehow sometimes on rare occasions I get numbers like 2.775557561562891e-17
So it's almost zero but not zero.......
first question - is this normal?
second question - as i understand it will be enough for me to do the second normalization to avoid tails?
Third question (I feel that I won't understand it anyway, but I'll ask anyway):
can addition of two normalized numbers give non-normalized numbers?
P.S. I apologize for bringing this up again, but I just don't have the strength to re-read it all again
Again about rounding......
Please advise on the situation (don't throw tomatoes, I'm a humanitarian),
there is such a variable:
double delta=NormalizeDouble(new_lot-sum_lots,Lots_Digits);
if(delta>0) delta-=OrderLots();
if(delta<0) delta+=OrderLots();
The delta is originally normalized,
OrderLots should probably return normalized dubs,
but somehow sometimes on rare occasions I get numbers like 2.775557561562891e-17
So it's almost zero but not zero.......
first question - is this normal?
second question - as i understand it will be enough for me to do the second normalization to avoid tails?
Third question (I feel that I won't understand it anyway, but I'll ask anyway):
can addition of two normalized numbers give non-normalized numbers?
P.S. Pardon me for bringing it up again, but I just don't have energy to reread it all
P.S. I apologise for bringing this up again, but I just don't have the energy to go through it all again
It's better to check it yourself with different examples, it will give you an understanding.
The only thing is, I'm doing it wrong:
but like this.
For double numbers. I don't know if it really matters, but with my variant I never encountered an error (I try to compare only the same types of variables).
I don't know if it really matters, but I've never encountered an error with my version (I only try to compare the same types of variables).