{"id":18654,"date":"2017-08-17T14:36:41","date_gmt":"2017-08-17T18:36:41","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=18654"},"modified":"2017-08-17T14:36:41","modified_gmt":"2017-08-17T18:36:41","slug":"bit-twiddling-hacks","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/08\/17\/bit-twiddling-hacks\/","title":{"rendered":"Bit Twiddling Hacks"},"content":{"rendered":"<p><a href=\"http:\/\/graphics.stanford.edu\/~seander\/bithacks.html\">Sean Eron Anderson<\/a> (<a href=\"https:\/\/www.reddit.com\/r\/programming\/comments\/fwjdh\/bit_twiddling_hacks\/\">Reddit<\/a>, <a href=\"https:\/\/news.ycombinator.com\/item?id=12026879\">Hacker News<\/a>) has a long list of code snippets:<\/p>\n<blockquote cite=\"http:\/\/graphics.stanford.edu\/~seander\/bithacks.html\">\n<p>As of May 5, 2005, all the code has been tested thoroughly.  Thousands of\npeople have read it.  Moreover, <a href=\"http:\/\/www-2.cs.cmu.edu\/~bryant\/\">\nProfessor Randal Bryant<\/a>, the Dean of Computer Science\nat Carnegie Mellon University, has personally tested almost everything\nwith his <a href=\"http:\/\/www-2.cs.cmu.edu\/~uclid\/\">Uclid code \nverification system<\/a>.  What he hasn&rsquo;t tested, I have checked against all\npossible inputs on a 32-bit machine.<\/p>\n<\/blockquote>\n<p>It sounds like they&rsquo;re correct, but that since the list dates to 2005 the performance characteristics may have changed.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sean Eron Anderson (Reddit, Hacker News) has a long list of code snippets: As of May 5, 2005, all the code has been tested thoroughly. Thousands of people have read it. Moreover, Professor Randal Bryant, the Dean of Computer Science at Carnegie Mellon University, has personally tested almost everything with his Uclid code verification system. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[45,71],"class_list":["post-18654","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=18654"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18654\/revisions"}],"predecessor-version":[{"id":18655,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18654\/revisions\/18655"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=18654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=18654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=18654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}