Stage 1 · Lesson 2 of 7
Text encodings and floating point
Characters are stored as numbers too. , an early scheme, gives 128 characters a number each, which fits in 7 . Unicode goes much further.
It gives every character in every script its own number, called a . UTF-8 is the usual way to store those code points, using one to four per character. Numbers with a fractional part are stored as , following a standard called IEEE 754.
Each number is kept as a sign, an exponent (the scale) and a fraction (the digits). Most decimal fractions cannot be stored exactly this way. That is why 0.1 + 0.2 is not exactly 0.3 in most languages. It is also why money is stored as whole cents or as a decimal type.
Common trapassuming one character is one byte, which breaks string lengths, database column sizes and file parsing as soon as someone types Urdu, Arabic or an emoji.
A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CourseFreeCS50: Introduction to Computer Science
Harvard University · Beginner
The first weeks in C teach binary, memory, pointers and the stack and heap with excellent problem sets
- VideoFreeCrash Course Computer Science
CrashCourse · Beginner
Short videos from transistors to CPUs and memory; the quickest way to see the whole picture