Hi,
I found a problem in below coding but don't know what causes it. Can someone please point out for me? Below are the coding:-
//Coding start here ------------------------------------------------------------
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int start()
{
double douleftprice, dourightprice;
dourightprice = 1.32184;
douleftprice = 1.32187 - 0.00003;
if (douleftprice == dourightprice)
Comment ("Match, douleftprice = ", DoubleToStr(douleftprice,8), ", dourightprice = ", DoubleToStr(dourightprice,8));
else
Comment ("Not Match, douleftprice = ", DoubleToStr(douleftprice,8), ", dourightprice = ", DoubleToStr(dourightprice,8));
return(0);
}
//Coding end here --------------------------------------------------
The result are "Not Match, douleftprice = 1.32184000, dourightprice = 1.32184000"
I got no idea how come it doesn't match. But if I change douleftprice from "1.32187 - 0.00003" to "1.32181 + 0.00003", it match. How come? What did I do wrong? Did I forgot to include anything?
I found a problem in below coding but don't know what causes it. Can someone please point out for me? Below are the coding:-
//Coding start here ------------------------------------------------------------
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int start()
{
double douleftprice, dourightprice;
dourightprice = 1.32184;
douleftprice = 1.32187 - 0.00003;
if (douleftprice == dourightprice)
Comment ("Match, douleftprice = ", DoubleToStr(douleftprice,8), ", dourightprice = ", DoubleToStr(dourightprice,8));
else
Comment ("Not Match, douleftprice = ", DoubleToStr(douleftprice,8), ", dourightprice = ", DoubleToStr(dourightprice,8));
return(0);
}
//Coding end here --------------------------------------------------
The result are "Not Match, douleftprice = 1.32184000, dourightprice = 1.32184000"
I got no idea how come it doesn't match. But if I change douleftprice from "1.32187 - 0.00003" to "1.32181 + 0.00003", it match. How come? What did I do wrong? Did I forgot to include anything?