
How Floating-Point Numbers Are Stored: Sign, Exponent and Mantissa
Learn the IEEE 754 layout of float and double, with the sign bit, biased exponent and fraction, decode real values by hand and check them with a C program.
Tag
362 posts

Learn the IEEE 754 layout of float and double, with the sign bit, biased exponent and fraction, decode real values by hand and check them with a C program.

Read raw frames with an AF_PACKET socket and parse Ethernet, IPv4 and TCP headers in C using the Linux header structs, with length checks at every layer.

Build and run OpenMP C programs with GCC 14 and Clang 19 on Linux, set the thread count, check that the pragma took effect, and fix the common link errors.

Point GDB at a debuginfod server with DEBUGINFOD_URLS and it downloads matching debug symbols and source for any shared library on demand, keyed by build ID.

A timing loop around a function can report zero, the wrong function or noise. Learn seven mistakes that make native benchmarks lie, with fixes.

Create FreeRTOS software timers with xTimerCreate: the five arguments, one-shot versus auto-reload, why a new timer is dormant and how to restart a one-shot.

Start a program from C with CreateProcessW, quote the command line correctly, redirect its output to a file, wait with a timeout and avoid handle leaks.

Handle a Pico button press with an RP2040 GPIO interrupt: the event mask, the callback signature, one shared callback for several pins, and a flag for main.

Decode an SPI flash ID read and an I2C TMP102 temperature read by hand from logic analyser captures, with sample points, start, stop and ACK bits explained.

Learn the three-step loop at the heart of every emulator: fetch an opcode, decode its fields, execute its effect, with a complete C example you can follow.

Learn why 1 KB can mean 1000 or 1024 bytes, how KiB and MiB settle it, and why a 1 TB drive shows up as 931 GiB, with a C program and numfmt examples.

Understand big-endian network byte order, why x86 and ARM hosts differ, and when to call htons, htonl, ntohs and ntohl in C socket code.