Type Casting Bug??
Hello,
In the first case, why didn't pres get assigned the value of -1*Logb(10,0.01) correctly?
MathRound() does the trick. So, it is probably as RaptorUK said: Logb(10,0.01) = 1.9999999....
But it doesn't make sense to me why the output of Alert() says: -Logb(10,0.01) = 2.00000000. Maybe it rounds it on its own.
Thanks.
...
But it doesn't make sense to me why the output of Alert() says: -Logb(10,0.01) = 2.00000000. Maybe it rounds it on its own.
Looks like the number gets rounded in the 9th decimal place.
Alert("Alert test #1: " + 1.99999999); Alert("Alert test #2: " + 1.999999999); Alert("Alert test #3: " + 1.999999991); Alert("Alert test #4: " + 1.999999995);
Looks like the number gets rounded in the 9th decimal place.
Yes. So, this was the culprit. Thanks
Hello,
Does anyone understand this weird behaviour bellow:
Output:
2013.08.24 08:44:48 me EURJPY.,H1: Alert: LotSize = 1.11611000, -Logb(10,0.01) = 2.00000000, pres = 1, norm = 1.10000000
But if I do this:
Output:
2013.08.24 08:46:37 me EURJPY.,H1: Alert: LotSize = 1.11611000, -Logb(10,0.01) = 2.00000000, pres = 2, norm = 1.12000000
In the first case, why didn't pres get assigned the value of -1*Logb(10,0.01) correctly?