It's a little ironic that this ties in with our discussion of coming from other languages: there are many in which 1 / 2 = 0.5, not 0. While I'm obviously very used to it, I've always regarded it as a counter-intuitive and pointless trap that 1 is treated as (int)1 regardless of cast/context. It's basically a legacy of times when computing power was too limited to put much intelligence into compilers, rather than a useful feature of a language.
The steps by which you then mis-identify something as an external change rather than a persistent bug in your code are, well... if you've never done it, you're the only programmer on earth who hasn't.
Maybe I was, who knows.
Anyway what is ridiculous is for experimented people to not even check the forum before claiming such things, everyone has to lean and make error, that's the path to knowledge. But claiming "a bug" or "try it" while this topic has been raised at least 10 times (as answered by WHR by the way), is the real issue.
And sorry but it's perfectly coherent and a good illustration my point on the other topic : a language, any language, should be learn on it's own, as much as possible. Never assume anything from your past experience, check it, try it, it's the basic of a scientific approach of life in general and of coding specifically, anything else is dogmatism.
And sorry but it's perfectly coherent and a good illustration my point on the other topic : a language, any language, should be learn on it's own, as much as possible. Never assume anything from your past experience, check it, try it, it's the basic of a scientific approach of life in general and of coding specifically, anything else is dogmatism.
probably my question is very simple and stupid. I would like to store the value of a division, in particular where is a integer value. I try to do it but I always get I try to enter a value fixed in x, for example but always get the same value .. what's Wrong?
Yet Python and Julia handle that division as I expected (maybe other languages too). Maybe MetaQuotes should adopt a style that is based on frequent usage rather than a mathematical logic😎
It's a little ironic that this ties in with our discussion of coming from other languages: there are many in which 1 / 2 = 0.5, not 0. While I'm obviously very used to it, I've always regarded it as a counter-intuitive and pointless trap that 1 is treated as (int)1 regardless of cast/context. It's basically a legacy of times when computing power was too limited to put much intelligence into compilers, rather than a useful feature of a language.
The steps by which you then mis-identify something as an external change rather than a persistent bug in your code are, well... if you've never done it, you're the only programmer on earth who hasn't.
Maybe I was, who knows.
Anyway what is ridiculous is for experimented people to not even check the forum before claiming such things, everyone has to lean and make error, that's the path to knowledge. But claiming "a bug" or "try it" while this topic has been raised at least 10 times (as answered by WHR by the way), is the real issue.
And sorry but it's perfectly coherent and a good illustration my point on the other topic : a language, any language, should be learn on it's own, as much as possible. Never assume anything from your past experience, check it, try it, it's the basic of a scientific approach of life in general and of coding specifically, anything else is dogmatism.
And sorry but it's perfectly coherent and a good illustration my point on the other topic : a language, any language, should be learn on it's own, as much as possible. Never assume anything from your past experience, check it, try it, it's the basic of a scientific approach of life in general and of coding specifically, anything else is dogmatism.
good point.
But seriously, I think the platform should at least show a warning on the incorrectness of the division. An implicit typecast can really help.
How can a result of division be zero when the numerator is not a zero? I don't understand how that math works.
Besides, I'm storing the answer in a double. How can it not be clear what I'm trying to do?
But seriously, I think the platform should at least show a warning on the incorrectness of the division. An implicit typecast can really help.
How can a result of division be zero when the numerator is not a zero? I don't understand how that math works.
Besides, I'm storing the answer in a double. How can it not be clear what I'm trying to do?
Integer division. It's perfectly clear concept taught in grade school.
The integer division of 1 by 2, gives 0 remaining 1.
Integer division. It's perfectly clear concept taught in grade school.
The integer division of 1 by 2, gives 0 remaining 1.
I remember skipping that class. 😎
Thanks anyway.
They did.