Skip to Content
Hacker’s Delight, Second Edition
book

Hacker’s Delight, Second Edition

by Henry S. Warren
September 2012
Intermediate to advanced
512 pages
12h 41m
English
Addison-Wesley Professional
Content preview from Hacker’s Delight, Second Edition

Chapter 9. Integer Division

9–1 Preliminaries

This chapter and the following one give a number of tricks and algorithms involving “computer division” of integers. In mathematical formulas we use the expression x / y to denote ordinary rational division, x ÷ y to denote signed computer division of integers (truncating toward 0), and Image to denote unsigned computer division of integers. Within C code, x/y, of course, denotes computer division, unsigned if either operand is unsigned, and signed if both operands are signed.

Division is a complex process, and the algorithms involving it are often not very elegant. It is even a matter of judgment as to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

TCP/IP Illustrated, Volume 1: The Protocols, 2nd Edition

TCP/IP Illustrated, Volume 1: The Protocols, 2nd Edition

Kevin R. Fall, W. Richard Stevens
Understanding the Linux Kernel, 3rd Edition

Understanding the Linux Kernel, 3rd Edition

Daniel P. Bovet, Marco Cesati

Publisher Resources

ISBN: 9780133084993Purchase book