ieee754 by YT

import std.c.stdio;void
main(){real r;char[9]t;int j,i;while(scanf("%s %Lf",t.ptr,&r)+1){i=9;float f=r;double d=r;ubyte*x=t[0]-'e'?t[0]-'d'?(i=3,cast(ubyte*)&f):(i=7,cast(ubyte*)&d):cast(ubyte*)&r;*x^=*x&&j++>17;for(;i+1;--i)printf("%.2x",x[i]);puts("");}}

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

download

return to the top page