问题
I am facing a problem running a C program on ARM processor.
#include <stdio.h>
#include <stdlib.h>
int main()
{
float f = -40.000000;
unsigned int a = f;
printf("\t Actual TX Power = %0.2f dBm \n",
(double)(int)a);
return 0;
}
outputs:
on x86- Actual TX Power = -40.00 dBm
on ARM- Actual TX Power = -0.00 dBm
The value survives the round-trip on x86 but not ARM.
I am not able to figure out what is the issue. What could be the reason behind it.
来源:https://stackoverflow.com/questions/60925860/unsigned-conversion-in-c-works-as-expected-on-x86-but-not-arm