FXCM Forex Trading

Bug? Paradox? can someone please explain?

All posts which do not fit into any other sections of the forum.

Moderator: admin

Bug? Paradox? can someone please explain?

Postby Marcello » Sat Apr 08, 2017 5:14 pm

Please see attached image and tell me what I'm doing wrong

Thanks
Attachments
Captura.PNG
Marcello
 
Posts: 17
Joined: Mon Jul 25, 2016 4:09 pm

Re: Bug? Paradox? can someone please explain?

Postby Konstantin.Toporov » Tue Apr 18, 2017 1:25 pm

I guess, it is a round error.
The difference between 2 doubles can be a very small double number but not exactly 0.
So in this case I would recommend to use:
Code: Select all
math.abs(triangle.ab - triangle.bc) < 1e-6

instead of direct comparison with 0.
Konstantin.Toporov
 
Posts: 34
Joined: Mon Aug 31, 2015 10:16 am

Re: Bug? Paradox? can someone please explain?

Postby Marcello » Tue Apr 25, 2017 6:03 pm

Thanks for the tip!!
Marcello
 
Posts: 17
Joined: Mon Jul 25, 2016 4:09 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests