Numbers and arithmetic · 1 of 4 Advanced
Integer division and digits
Use the quotient and remainder to read the digits of a number, write it in another base, and convert spreadsheet column labels, with the one place where Python and C++ disagree.
- Binary arithmetic operations Defines // as floor division and gives % the sign of its second operand: the rules behind the Python column of the table of negative remainders. docs.python.org (opens in a new tab)
- Arithmetic operators The multiplicative operators section states that integer division truncates toward zero and that (a / b) * b + a % b equals a. en.cppreference.com (opens in a new tab)
- Bijective numeration Number systems that have no zero digit. Its section on the bijective base-26 system is the spreadsheet column scheme, with A = 1 up to Z = 26. en.wikipedia.org (opens in a new tab)
- Open Data Structures, Chapter 1: Introduction Section 1.3 reviews exponentials, logarithms and factorials, and reads \log_b k as the number of times k can be divided by b before the result is 1 or less. Parts of this page adapt this chapter’s text, licensed CC BY 2.5 Canada (creativecommons.org/licenses/by/2.5/ca), with changed wording, examples and code. opendatastructures.org (opens in a new tab)