liveBook · Manning

Numeric base

A numeric base, or radix, is the positional numeral-system value that determines a numeral’s digit set and the place-value scale of its digits.

How 2 Manning books explain it

Python Workout, Second Edition

A number base is the radix that determines the positional values of digits in a numeral system.

How it is used
Uses numeric bases to interpret string input as integers during conversion exercises.
How deep it goes
Explains int’s base argument and practices bases 2–16, without detailing numeral-system internals.
Examples
Uses hexadecimal conversion and a guessing game that accepts numbers in randomly selected bases.
What you can do after
Apply it via Python’s int function to interpret user-entered strings in a specified base.

Read how Python Workout, Second Edition explains numeric base →

Modern C

A number base is the radix used to interpret the positional digits of a numeric string.

How it is used
Uses numeric bases to parse textual numbers from lines and command-line arguments.
How deep it goes
Explains specified and prefix-deduced bases with worked parsing boundaries, but defers conversion-function internals.
Examples
Demonstrates base 10 and base 0 on "0789a", then applies base 0 to a command-line argument.
What you can do after
Apply it via strtoul or strtoull to choose explicit bases or prefix-based interpretation for numeric strings.

Read how Modern C explains numeric base →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.