On Mon, 10 Jul 2023 at 19:23, <henri.cloetens@xxxxxxxxxx> wrote: > > Hello Amit, > > If you want to do this conversion in C, proceed as follows : > > #include "stdio.h" > #include "stdlib.h" > > int main() > { > float a = 3.2444422 ; > int *p = (int *)(&a) ; > fprintf(stderr,"%08x\n",*p) ; > } > > It will print the hex value, which happens to be the same as yours on my > machine. That code has undefined behaviour. This would be valid: float a = 3.2444422 ; int i; memcpy(&i, &f, sizeof(int)); fprintf(stderr,"%08x\n",i) ;