How do the numbers 1101004800 correspond to number 20?

I'm trying to learn how to change memory locations using C ++, and when messing around with MineSweeper, I noticed that when the clock in memory was 1101004800, it was 20 seconds in the game. Signs 1101529088 correspond to 21 seconds in the game. Can someone please explain to me how to convert between these 10 digit long numbers in base-10?

+7
source share
2 answers

They use floats to represent a timer. Here is a program that converts your integers to float:

#include <stdio.h> int main() { int n = 1101004800; int n2 = 1101529088; printf("%f\n", *((float*)&n)); printf("%f\n", *((float*)&n2)); return 0; } 

Output:

 20.000000 21.000000 
+8
source

1101004800 decimal is 0x41A00000 hex, which is a representation of IEEE-754 20.0 . 1101529088 decimal is 0x41A80000 hex, which is a representation of IEEE-754 21.0 .

+4
source

All Articles