Miguel Antonio Rojas Martinez:
This is because 10/20 evaluates to 0 in programming languages like C, C++, C# and MQLx. The compiler sees two integers, 10 and 20, and so performs an integer division which results in 0. Try 10.0/20.
Today I have noticed something strange, for some tests of an expert that I am doing. I wanted to print a value of a double, but to my surprise, you can not.
I explain what I have noticed: only if the value of the double is in the declaration of the variable, it is printed
Before this did not happen, before I could add two integers and when printed the result appeared "double".
Is it a bug or did they just get more demanding when working with integers and doubles?
result:
http://prntscr.com/mg8knf
As it is displayed in the results, only the declared value was printed correctly
I repeat my question: is it something new that is implemented when working with integers and doubles or is it a detail to be corrected?
lippmaje:
This is because 10/20 evaluates to 0 in programming languages like C, C++, C# and MQLx. The compiler sees two integers, 10 and 20, and so performs an integer division which results in 0. Try 10.0/20.
This is because 10/20 evaluates to 0 in programming languages like C, C++, C# and MQLx. The compiler sees two integers, 10 and 20, and so performs an integer division which results in 0. Try 10.0/20.
OK thank you very much,
I was really convinced (most probably wrongly) that this was resolved "automatically" without passing the integers to double
thanks!
Miguel Antonio Rojas Martinez:
👍
OK thank you very much,
I was really convinced (most probably wrongly) that this was resolved "automatically" without passing the integers to double
thanks!
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
Is it a bug or did they just get more demanding when working with integers and doubles?
result:
http://prntscr.com/mg8knf
As it is displayed in the results, only the declared value was printed correctly
I repeat my question: is it something new that is implemented when working with integers and doubles or is it a detail to be corrected?