Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Casting integer to floating point
#1
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 )?
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)