Skip to content

Instantly share code, notes, and snippets.

View trxcllnt's full-sized avatar

Paul Taylor trxcllnt

  • NVIDIA, Inc
  • Portland, OR
  • 18:38 (UTC -07:00)
  • X @inlineptx
View GitHub Profile
@leodutra
leodutra / bitwise-hacks.js
Last active February 27, 2025 01:45
Fast Int Math + Bitwise Hacks For JavaScript
// http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html
// http://jsperf.com/bitwise-vs-math-object
// http://united-coders.com/christian-harms/results-for-game-for-forfeits-and-the-winner-is/
// https://mudcu.be/journal/2011/11/bitwise-gems-and-other-optimizations/
// https://dreaminginjavascript.wordpress.com/2009/02/09/bitwise-byte-foolish/
// http://jsperf.com/math-min-max-vs-ternary-vs-if/24
"use strict";
var PI = Math.PI;