@Peter Williams#: Fernando - another simple example of a simple EA & it's output
Your post does not have a question. What is it that you wish to know?
In your examples, both "c1 = a1 / b1" and "c2 = a2 / b2", carry out integer division. Even if the results are assigned to a "double", they are still the results of integer division.
If that is not want you want or expect, then apply typecasting as shown in my examples so that it will carry out floating point division.
Your post does not have a question. What is it that you wish to know?
In your examples, both "c1 = a1 / b1" and "c2 = a2 / b2", carry out integer division. Even if the results are assigned to a "double", they are still the results of integer division.
If that is not want you want or expect, then apply typecasting as shown in my examples so that it will carry out floating point division.
Apologies for the confusion I was just adding examples which I thought maybe a useful illustration - no question
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Your post does not have a question. What is it that you wish to know?
In your examples, both "c1 = a1 / b1" and "c2 = a2 / b2", carry out integer division. Even if the results are assigned to a "double", they are still the results of integer division.
If that is not want you want or expect, then apply typecasting as shown in my examples so that it will carry out floating point division.
Your post does not have a question. What is it that you wish to know?
In your examples, both "c1 = a1 / b1" and "c2 = a2 / b2", carry out integer division. Even if the results are assigned to a "double", they are still the results of integer division.
If that is not want you want or expect, then apply typecasting as shown in my examples so that it will carry out floating point division.
As I stated, learn about typecasting — Typecasting - Data Types - Language Basics - MQL4 Reference.
Don't use string manipulation. That is incorrect and inefficient.
... or more simply, you can rely on implicit typecasting ...
... or inline typecasting ...