How can I convert this UInt64
to a float
?
UInt64 MyLongInt = 14250221004866263104;
float My4ByteFloat = MyLongInt;
Console.WriteLine(My4ByteFloat);
This has to do with a memory read I am performing. The value I am retrieving is an UInt64
and corresponds to 14250221004866263104
. And I need to convert it to float
since I know for a fact that my address is a float
. Now when I do it with Cheat Engine it converts it correctly and gives me this result: -7088
.
When I do it with C#
it gives me 1425002E+19
.
Now I know that converting 8 bytes to 4 bytes is not the best thing to do and there might be some issues during the process but, since Cheat Engine is doing it and it is getting the right result, then it must be possible.
So anyone know how to convert this UInt64
to float
?