Buy used:
$59.98
FREE delivery Saturday, October 19
Or Prime members get FREE delivery Thursday, October 17. Order within 4 hrs 24 mins.
Used: Very Good | Details
Condition: Used: Very Good
Comment: The book has been read, and is in excellent condition. Pages are intact and not marred by notes or highlighting. The spine remains undamaged. All books are cleaned and shrink wrapped. •Fast shipping with Amazon Prime •Guaranteed tracking number •Amazon’s hassle-free return policy
Access codes and supplements are not guaranteed with used items.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Follow the author

Something went wrong. Please try your request again later.

Hacker's Delight First Edition

4.4 4.4 out of 5 stars 40 ratings

There is a newer edition of this item:

Hacker's Delight
$48.89
(223)
In Stock
This book is for anyone who wants to create efficient code. Hacker's Delight will help you learn to program at a higher level - well beyond what is generally taught in schools and training courses - and will advance you substantially further than is possible through ordinary self-study alone.

Amazon First Reads | Editors' picks at exclusive prices

Editorial Reviews

From the Back Cover

"This is the first book that promises to tell the deep, dark secrets of computer arithmetic, and it delivers in spades. It contains every trick I knew plus many, many more. A godsend for library developers, compiler writers, and lovers of elegant hacks, it deserves a spot on your shelf right next to Knuth."

--Josh Bloch

"When I first saw the title, I figured that the book must be either a cookbook for breaking into computers (unlikely) or some sort of compendium of little programming tricks. It's the latter, but it's thorough, almost encyclopedic, in its coverage."

--Guy Steele

These are the timesaving techniques relished by computer hackers--those devoted and persistent code developers who seek elegant and efficient ways to build better software. The truth is that much of the computer programmer's job involves a healthy mix of arithmetic and logic. In Hacker's Delight, veteran programmer Hank Warren shares the tricks he has collected from his considerable experience in the worlds of application and system programming. Most of these techniques are eminently practical, but a few are included just because they are interesting and unexpected. The resulting work is an irresistible collection that will help even the most seasoned programmers better their craft.

Topics covered include:

  • A broad collection of useful programming tricks
  • Small algorithms for common tasks
  • Power-of-2 boundaries and bounds checking
  • Rearranging bits and bytes
  • Integer division and division by constants
  • Some elementary functions on integers
  • Gray code
  • Hilbert's space-filling curve
  • And even formulas for prime numbers!

This book is for anyone who wants to create efficient code. Hacker's Delight will help you learn to program at a higher level--well beyond what is generally taught in schools and training courses--and will advance you substantially further than is possible through ordinary self-study alone.



0201914654B06272002

About the Author

Henry S. Warren, Jr., has had a forty-year career with IBM, spanning from the IBM 704 to the PowerPC. He has worked on various military command and control systems and on the SETL project under Jack Schwartz at New York University. Since 1973 he has been with IBM's Research Division, focusing on compilers and computer architectures. Hank currently works on the Blue Gene petaflop computer project. He received his Ph.D. in computer science from the Courant Institute at New York University.



0201914654AB06272002

Product details

  • Publisher ‏ : ‎ Addison-Wesley; First Edition (January 1, 2002)
  • Language ‏ : ‎ English
  • Hardcover ‏ : ‎ 306 pages
  • ISBN-10 ‏ : ‎ 0201914654
  • ISBN-13 ‏ : ‎ 978-0201914658
  • Item Weight ‏ : ‎ 1.25 pounds
  • Dimensions ‏ : ‎ 6.5 x 1 x 9.25 inches
  • Customer Reviews:
    4.4 4.4 out of 5 stars 40 ratings

About the author

Follow authors to get new release updates, plus improved recommendations.
Henry S. Warren
Brief content visible, double tap to read full content.
Full content visible, double tap to read brief content.

There's a short bio on the back cover of Hacker's Delight.

I want to point out here the existence of www.HackersDelight.org. This site will have errata files for the book (second edition) as errors are found. It has C code for the algorithms in the book and many similar algorithms.

Customer reviews

4.4 out of 5 stars
40 global ratings

Customers say

Customers find the book contains a great collection of techniques and tricks for highly efficient numerical operations. They say it explains the tricks very clearly and is exceptional for learning fast implementations of base-2 operations. Readers also describe the content as interesting and a great read.

AI-generated from the text of customer reviews

Select to learn more
9 customers mention "Knowledge level"9 positive0 negative

Customers find the book contains a great collection of techniques and tricks for highly efficient numerical programming. They say it explains the tricks very clearly and is exceptional for learning fast implementations of base-2 operations. Readers also mention the exposition is practical and no deep mathematical skills are required to understand it. In addition, they mention the book has good material on computer arithmetic and is good for a brain teaser.

"...This book is for real hackers. It's a great collection of tricks for performing usually simple operations in an elegant way. What's elegant?..." Read more

"...6 "Counting Bits" and "Searching Words" There is some good material on computer arithmetic including using a radix -2 system, and a chapter on..." Read more

"...This book also *explains* the tricks very clearly. That's why it rocks. Warren doesn't talk to you like a professor, but like a good friend...." Read more

"...The exposition is practical, and no deep mathematical skills are required to understand it...." Read more

3 customers mention "Readability"3 positive0 negative

Customers find the book great and interesting. They say it provides a different view of bit-wise tricks.

"...This book is fantastic - I kid you not - on the first page of Chapter 2, for example, I discovered at least five or six capriciously clever tricks..." Read more

"Interesting content. Very good to have a different view of bit-wise tricks. Also good for a brain teaser I guess =)" Read more

"...Great read." Read more

Top reviews from the United States

Reviewed in the United States on October 22, 2002
I feel compelled to point out that this book is _not_ a few things: It's not a book that teaches you how to break into computers, or crack codes. It's also not the kind of book that teaches you how to do something which you don't know how to do.
This book is a collection of tricks that show the reader better ways to do things they already know how to do. And it's also a book that can give the reader insight into different approaches and mechanisms for solving problems.
Computer programmers translate their ideas and requirements into any of several computer languages. Those expressions are limited by the language the programmer is using, and maybe even the machine the programmer is targeting. But there is a wide continum of expressions that result in the same -- hopefully correct -- results. Choosing the most efficient, and most elegant, expression to some is "real" hacking.
This book is for real hackers. It's a great collection of tricks for performing usually simple operations in an elegant way. What's elegant? Well, elegant is efficeint. If there's a side-effect of an elegant operation, it turns out that side-effect is probably useful and not simply discarded.
This book catalogs insights into concrete binary math, shortcuts derived from different boolean operators, and even approaches some interesting numerical analysis problems.
If you already know how to write software, and you already know you want to find faster or more efficient ways to check for overflows on integers, divide nubmers, count bits, search for binary patterns, or do other twiddling, then this book is for you.
If the application of such techniques doesn't seem important to you, then this book probably isn't going to be of interest to you.
73 people found this helpful
Report
Reviewed in the United States on April 27, 2005
Warren was one of the editors of the PowerPC compiler guide and that book had two neat chapeters, "Clever Examples," and "Optimal Code Sequences," which introduced the use of the gnu superoptimzer. The PPC Compiler Writer's guide was useful for more than Compiler Writers! Warren's book Hacker's Delight is a greatly expanded version of that material. He introduces a basic RISC and proceeds to give C, pseudocode and basic RISC assembly for many different operations. What distinguishes Hacker's Delight is that he goes into cycle counts and optimzation strategies for some of the algorithims and analyzes tradeoffs for different solutions. Some of bits I have applied the techniques to my day job are in ch. 7: Rearranging Bits and Bytes and Chs. 5 & 6 "Counting Bits" and "Searching Words" There is some good material on computer arithmetic including using a radix -2 system, and a chapter on Hilbert's Curves as well as Primes, which I haven't gotten a chance to enjoy yet. Be sure to check his website for errata and some additional material. Highly Recommended.
9 people found this helpful
Report
Reviewed in the United States on August 16, 2012
This book presents a ton of bit-shifting tricks and techniques, along with detailed discussion of why we can be sure that they work and even some discussion of how/why it might be faster to use his trick versus some other approach. If you work on low level applications and/or spend a lot of time in machine language, then this could be a very useful book. If you don't, then beware: you could easily work an entire career as a highly skilled programmer using multiple high level languages, and never need a single thing mentioned in here. And while some of the bit shifting tricks might be considered "neat" in the sense that your inner geek might enjoy, I don't think it's nearly "neat" enough. Unless you fully intend to use this stuff, it's not worth troubling your synapses to fire on it; (seriously, discussion of how some machine code might pipeline better than some other machine code: that's what you're getting yourself into here, if you decide to read this book cover to cover). It is now on my shelf and I know it's there in the unlikely event that I'll need it, but otherwise I actually only read about half of it before unapologetically skimming the rest.
8 people found this helpful
Report
Reviewed in the United States on March 23, 2007
I have a virtual calculator called the DIY Calculator that accompanies my own book "How Computers Do Math" The Definitive Guide to How Computers Do Math : Featuring the Virtual DIY Calculator.

I recently added a "Conundrums, Puzzles, and Posers" section to the "Programs and Subroutines" page on my DIY Calculator website ([...]) and I've started to build a collection of simple puzzles for people to play with.

One of the first problems I posed was to count the number of ones in the 8-bit accumulator and to present the result as a binary value. I thought I had discovered the best-possible solution, until someone pointed me in the direction of the "Hacker's Delight". (In this context, "Hacker" refers to a hero who is manipulating code; not a nefarious rapscallion who breaks into other people's computer systems.)

I immediately ordered a copy from Amazon, and took delivery just yesterday as I pen these words. This book is fantastic - I kid you not - on the first page of Chapter 2, for example, I discovered at least five or six capriciously clever tricks that blew my solutions out of the water!

I highly recommend this book.
6 people found this helpful
Report
Reviewed in the United States on December 7, 2010
Most of the stuff in this book, usually also more updated, is of course available on the web. I knew most of the tricks from Agner Fog's works, the 'aggregate magic algorithms' and other sources. But that is hardly a critique of this book.

This book also *explains* the tricks very clearly. That's why it rocks. Warren doesn't talk to you like a professor, but like a good friend. He explains stuff, often in plain English, the way we all do when we really want someone to understand what we mean.

He uses some math too, but only when really appropriate, never in a pedantic way or to impress us with his vast knowledge (like a professor would).

This book sports a quick little introduction to RISC assembly, a couple of silly little poems, formulas for prime numbers... how can I explain it?
3 people found this helpful
Report

Top reviews from other countries

Translate all reviews to English
Ulrich
5.0 out of 5 stars Die Grundlagen der Grundlagen...
Reviewed in Germany on April 17, 2011
Für den Entwickler von Anwendungen in Hochsprachen (z.B. C# oder Java) mag dieses Buch weniger nützlich bzw. uninteressant sein.
Wer aber das letzte aus seiner in C, C++ oder Assembler programmierten Hardware herausholen will oder muß, findet "optimalste" Algorithmen für eine Vielzahl von Grundproblemen. Auch wer sich interessehalber mit Algorithmen auf der Ebene der Bit-Manipulation beschäftigen will, wird in diesem Buch viel Anregendes finden.
Gestaltung und Layout halte ich für gelungen und übersichtlich, der Hardcover-Einband passt zu diesem zeitlosen Referenz- und Nachschlagewerk.
JK
5.0 out of 5 stars Well done
Reviewed in Germany on August 17, 2015
Book with many samples. Not much new stuff for someone that had C and Assembler in school but great for looking up stuff. What I expected :)