I need someone to explain this to me. I was looking at the disassembly of this:
Code:
void func (void)
{
float fl_one = 0.0f;
float fl_two = 0.0f;
float fl_ans = 0.0f;
fl_one = 2.2f;
fl_two = 3.5f;
fl_ans = fl_one + fl_two;
}
The disassembly of the assignment is as follows:
Code:
mov dword ptr [fl_one],400CCCCDh
mov dword ptr [fl_two],40600000h
How the hell does 400CCCCDh represent 2.2? I replaced "fl_one = 2.2f;" with
Code:
mov fl_one, 400CCCCDh
And it works so I assume the hex number isn't something to do with the compiler storing values (or something).
Can someone explain / link to how floating point vals are represented in hex? I would prefer someone explaining it