04-10-2016, 12:46 PM
I have the following code:
int16_t int_torque_I_MUL;
float32_t f_temp1;
...
f_temp1 = (float32_t)(int_torque_I_MUL);
...
The above will generate:
MISRA-C:2012 R.10.1,R.10.3,R.10.4,R.10.5,R.11.1: Value is not of appropriate type. : (double and short)
But I don't understand why??
How can I cast a signed 16 bit integer to a double (float32_t )?
int16_t int_torque_I_MUL;
float32_t f_temp1;
...
f_temp1 = (float32_t)(int_torque_I_MUL);
...
The above will generate:
MISRA-C:2012 R.10.1,R.10.3,R.10.4,R.10.5,R.11.1: Value is not of appropriate type. : (double and short)
But I don't understand why??
How can I cast a signed 16 bit integer to a double (float32_t )?
<t></t>