#include <iostream>
#include <string>
#include <bitset>
std::string PrintBinary(float val)
{
std::bitset<32> bits(*reinterpret_cast<int *>(&val));
return bits.to_string();
}
int main ()
{
double b = 0.0;
float a = - (float) b;
std::cout << PrintBinary(a) << std::endl;
printf("a == %.2f %s 0\n", a, a == 0 ? "==": "!=");
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Yml0c2V0PgoKc3RkOjpzdHJpbmcgUHJpbnRCaW5hcnkoZmxvYXQgdmFsKQp7CiAgICBzdGQ6OmJpdHNldDwzMj4gYml0cygqcmVpbnRlcnByZXRfY2FzdDxpbnQgKj4oJnZhbCkpOwoJcmV0dXJuIGJpdHMudG9fc3RyaW5nKCk7Cn0KCmludCBtYWluICgpCnsKCWRvdWJsZSBiID0gMC4wOwoJZmxvYXQgYSA9IC0gKGZsb2F0KSBiOwoKCXN0ZDo6Y291dCA8PCBQcmludEJpbmFyeShhKSA8PCBzdGQ6OmVuZGw7CglwcmludGYoImEgPT0gJS4yZiAlcyAwXG4iLCBhLCBhID09IDAgPyAiPT0iOiAiIT0iKTsKfQ==