Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22070

unsigned conversion in C works as expected on x86 but not ARM [duplicate]

$
0
0

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.


Viewing all articles
Browse latest Browse all 22070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>