#include <math.h>
#include <stdio.h>
void dispf(float f)
{
char str[32];
char* pc;
unsigned char* pf;
int i, b;
pf = (unsigned char*)&f;
pc = str;
for (i = 0; i < 4; i++) {
for (b = 0; b < 8; b++) {
*pc++ = '0'+((pf[3-i]>>(7-b))&1);
}
}
printf("%.1s %.8s %.23s\n", str
, str
+ 1, str
+ 9); }
int main()
{
char s[32];
float a, b, c;
a = (float)1970.199707;
dispf(a);
dispf(b);
c = fabsf(a - b);
dispf(c);
printf("%s\n", (c
<=0.001)?"true":"false"); return 0;
}
I2luY2x1ZGUgPG1hdGguaD4KI2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGRpc3BmKGZsb2F0IGYpCnsKCWNoYXIJCXN0clszMl07CgljaGFyKgkJcGM7Cgl1bnNpZ25lZCBjaGFyKglwZjsKCWludAkJaSwgYjsKCglwZiA9ICh1bnNpZ25lZCBjaGFyKikmZjsKCXBjID0gc3RyOwoJZm9yIChpID0gMDsgaSA8IDQ7IGkrKykgewoJCWZvciAoYiA9IDA7IGIgPCA4OyBiKyspIHsKCQkJKnBjKysgPSAnMCcrKChwZlszLWldPj4oNy1iKSkmMSk7CgkJfQoJfQoJcHJpbnRmKCIlLjFzICUuOHMgJS4yM3NcbiIsIHN0ciwgc3RyICsgMSwgc3RyICsgOSk7CglwcmludGYoIiVFXG4iLCBmKTsKCXByaW50ZigiJWZcbiIsIGYpOwp9CgppbnQgbWFpbigpCnsKCWNoYXIJc1szMl07CglmbG9hdAlhLCBiLCBjOwoKCXByaW50ZigiYSA9IDE5NzAuMTk5NzA3XG4iKTsKCWEgPSAoZmxvYXQpMTk3MC4xOTk3MDc7CglkaXNwZihhKTsKCXNwcmludGYocywgIiVFIiwgYSk7CglwcmludGYoImIgPSAlc1xuIiwgcyk7Cglzc2NhbmYocywgIiVFIiwgJmIpOwoJZGlzcGYoYik7CglwcmludGYoImMgPSBmYWJzZihhIC0gYilcbiIpOwoJYyA9IGZhYnNmKGEgLSBiKTsKCWRpc3BmKGMpOwoJcHJpbnRmKCIlc1xuIiwgKGM8PTAuMDAxKT8idHJ1ZSI6ImZhbHNlIik7CglyZXR1cm4gMDsKfQo=