For the following code
float x = -32768.0f;
int x_i = (int) x;
long x_l_1 = (int) x;
long x_l_2 = (long) x;
long x_l_3 = (int) -32768.0f;
compiled with TMS320C24xx ANSI C Compiler, Version 7.04 I get on a TMS320LF2407A the following results (in the watch window from CCS3.3):
x: -32768.0
x_l_3: -32768
x_i: -29186
x_l_1: 167422
x_l_2: -32768
The values of x_i and x_l_1 are unexpected. Can someone please comment on this?
Regards
Johannes