Double treated as int

Double treated as int

mischa_spelt
Advisor Advisor
2 Views
2 Replies
Message 1 of 3

Double treated as int

mischa_spelt
Advisor
Advisor

[ FlexSim 18.0.3 ]

Here's a question: what do you expect that

double a = 2443816867;
return a;

returns?

  1. The literal constant on the first line
  2. MAX_INT

Hint: the answer is different when you write

double a = 2443816867.0;
0 Likes
Accepted solutions (1)
3 Views
2 Replies
Replies (2)
Message 2 of 3

philboboADSK
Autodesk
Autodesk
Accepted solution

In C++, that returns 2443816867.0 as it should. In FlexScript, it is returning 2147483647.0 (MAX_INT).

I'll add a note to the dev list to look into fixing this.



Phil BoBo
Sr. Manager, Software Development
Message 3 of 3

mischa_spelt
Advisor
Advisor

Thanks.

0 Likes