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
The devil is in the mix... 2.6, of course.
It's time for bed.
What's 5? Normalising such a number turns all 9's into zeros, so normalising and then discarding would give wrong results.
DoubleToString(0.99999,5)
Well, what if the number is 0.99999 and you have to leave two digits? Discard the rest. We need to get 0.99. So we normalize it to three digits, get 1.000, discard one, and get 1.00, but not 0.99.
Well, what if the number is 0.99999 and you have to leave two digits? Discard the rest. We need to get 0.99. So we normalize it to three digits, get 1.000, discard one, and get 1.00, but not 0.99.
Yeah... and suddenly we have the number 0.999999 instead of 0.999999.
It reminds me of a joke about a programmer who has gone missing. He was sitting in a cold bath, shampoo in his hands with the instruction "soap, rinse and repeat".
Well, what if the number is 0.99999 and you have to leave two digits? Discard the rest. We need to get 0.99. So, according to the algorithm suggested above, normalize to three digits, we get 1.000, discard one and get 1.00, but not 0.99.
try to get a result of0.99999999999999999
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