Tagged “math”
-
TIL the Quake 3 Fast Inverse Square Root hack math videogames magicnumber
Quake III Arena, a first-person shooter video game, was released in 1999 by id Software and used the algorithm.
-
TIL that the max size of a Map/Set is 26843544 javascript mdn v8 math
JS Maps and Sets are implemented by OrderedHashTable. OrderedHashTables double in size when they need to grow, and their max size is 26843544. After 16777216 elements, doubling that exceeds the max, so the allocation fails.Currently these data structures are not implemented to be usable for large in-memory datasets. Also note that the JS specification itself doesn't require that Maps and Sets must scale with available memory.
-
TIL the WebCrypto API javascript mdn math
If you dealing with sensitive applications and need a more secure method of randomization, I’d recommend the Crypto API. Reasons you may want to use WebCrypto include temporary verification codes, random password generation, randomized lottery numbers, etc.
-
TIL the origins of the term Algorithms history math trivia
Muhammad ibn Musa al-Khwarizmi's name is a reference to where he was from — 'al-Khwarizm' means that he was from Khwarazm, a region roughly on the border of modern-day Uzbekistan and Turkmenista. Al-Khwarizmi was, somehow, recorded as something close to 'Algorizmi' which, in turn, became our all-purpose math word: algorithm.
-
TIL that 2^24 items will cause a interesting error math javascript errors
Obviously there's not much real use-cases. But that's the fun of finding limitations.
-
TIL the XOR operator in Javascript javascript math
The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones).
-
TIL Higher Order functions to reduce loops math loops javascript
Higher Order Functions like Sum, Map, Filter, Reduce
-
TIL Avoiding Off-by-one errors and state using Recusion math loops javascript
Recursion is a function that calls itself.
-
TIL Stateful and stateless math loops javascript
An expression in a programming language can be “stateful” or “stateless”.
-
TIL One-by-one errors math loops javascript codepen
An off-by-one error is when you expect something to be of value N, but in reality it ends up being `N-1` or `N+1`.
-
TIL the problem with using Loops math loops javascript
Loops tend to have some flaws. Instead use Higher Order Functions
See all tags.