
NaN, Infinity and Negative Zero Explained
Learn what IEEE 754 NaN, infinity and negative zero are, how they arise, why NaN is not equal to itself, and how to test for each safely in C.
Everything you need to level up your coding skills.

Learn what IEEE 754 NaN, infinity and negative zero are, how they arise, why NaN is not equal to itself, and how to test for each safely in C.

See why 0.1 and 0.2 have no exact binary form, how their stored values add to 0.30000000000000004, and what to do about it in C code with %.17g and hex output.

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.

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.

Learn what a bit, nibble, byte, word and doubleword are, why a word has no single size, and how C reports the real sizes of its types on your platform.

Understand H.264 profiles (Baseline, Main, High) and levels (3.1, 4.1, 5.1): what they limit, how to compute a level from size and rate, and how to set them.

Convert numbers between binary, decimal and hexadecimal on paper with place values, repeated division and nibble grouping, then check the result in C.

Follow one H.264 frame through the encoder: macroblocks, intra and inter prediction, the 4x4 integer transform, quantisation, deblocking and CAVLC or CABAC.

Learn what octal is, how three bits map to one octal digit, and why chmod 755 and the C leading zero still use base 8 on Unix systems today.

Choose between MP4, MKV and WebM by use case: web playback, archiving, editing and streaming, with what each allows and the FFmpeg commands to convert.

Learn what hexadecimal is, how each hex digit maps to four bits, and why base 16 is the standard shorthand for bytes, addresses and colours in C.
We send one email when a new post is published. No spam.