ieee754 by examiner

main(i){char t[99];long double r;while(scanf("%s %Lf",t,&r)>0){float
f=r;double d=r;unsigned char*x=&r;i=9;if(*t-'e')if(*t-'d')x=&f,i=3;else
x=&d,i=7;for(;i>=0;--i)printf("%.2x",x[i]^(*t=='e'&&r>3&&r<4&&!i));puts("");}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page