double variable with wrong decimal cases - page 2 12 New comment William Roeder 2018.01.16 14:37 #11 Icham Aidibe: It's unaesthetic, but it's expeditive and it works :-/Since the maximum of an int is 2147483647 (0x7FFFFFFF) your code will never work and I'm not sure what you are trying to do. Icham Aidibe 2018.01.16 14:41 #12 whroeder1: Since the maximum of an int is 2147483647 (0x7FFFFFFF) your code will never work and I'm not sure what you are trying to do.Indeed it's converted as a double, but with no more decimals. William Roeder 2018.01.16 15:35 #13 Icham Aidibe: Indeed it's converted as a double, but with no more decimals. int k=1000000000000000000000000000000000000000000000000000000000000000000;No it's not. Icham Aidibe 2018.01.18 02:17 #14 whroeder1: No it's not.I tell you it is.integer constant is too big, so it was converted into double 0 error(s), 1 warning(s), compile time: 2117 msec [Deleted] 2018.01.18 14:43 #15 Icham Aidibe: I tell you it is.It is not, and here is why!The constant value is converted into a "double", but then it is reconverted/cast into an "int" again in order to be saved in the variable "k".There is in fact two warnings (not just one):integer constant is too big, so it was converted into doubletruncation of constant valueThe end result, is that "k" will be left with the value of "-2147483648".Had you printed your values, you would have seen that. Double to int Any questions from newcomers need help to fix fxsaber 2018.01.18 20:59 #16 MyNormalizeDouble 12 New comment
Since the maximum of an int is 2147483647 (0x7FFFFFFF) your code will never work and I'm not sure what you are trying to do.
Since the maximum of an int is 2147483647 (0x7FFFFFFF) your code will never work and I'm not sure what you are trying to do.
Indeed it's converted as a double, but with no more decimals.
No it's not.
No it's not.
I tell you it is.
It is not, and here is why!
Had you printed your values, you would have seen that.
MyNormalizeDouble