Explore >> Select a destination


You are here

www.trevorlasn.com
| | arnorhs.dev
2.4 parsecs away

Travel
| | I read somewhere that a bitwise left shift was a faster method of removing a fraction of a floating point number in Javascript than using parseInt or Math.floor(). I wasn't surprised that parseInt was slow, since I think it parses the number as a string, but the left shift being faster than Math.floor() was a bit more puzzling to me. So I decided to make a JSPerf test to compare those three methods. Read on for the full results
| | wizardzines.com
3.7 parsecs away

Travel
| |
| | james.darpinian.com
3.1 parsecs away

Travel
| | You may know that all numbers in JavaScript are 64 bit double-precision floating point values. This is sometimes convenient and it works pretty well as a default for novice programmers, who are often confused by integer math, and rightfully so when 1 / 2 = 0. Unfortunately, it makes things slow. Doubles take a lot of memory and floating point math is slower than integer math on CPUs. It's also inconvenient if you want to port existing code to JavaScript, because existing code usually expects to use integ...
| | jahir.dev
20.1 parsecs away

Travel
| A journey turning skepticism and dislike into enthusiasm