As cppreference says "In IEEE 754, the most common binary representation of floating-point numbers, the positive infinity is the value with all bits of the exponent set and all bits of the fraction cleared.". I tried this code snippet, but I don't see exponent bits set. Am I wrong somewhere?
#include <iostream>
#include <limits>
#include <bitset>
#include <math.h>
using namespace std;
int main() {
float a = 0b00000000000000000000000000000000;
double b = std::numeric_limits<double>::infinity();
bitset<64> x(b);
cout<<x<<endl;
return 0;
}
It prints 0000000000000000000000000000000000000000000000000000000000000000 on console.