Blog

POW – Sequential Triad 24

Many people are familiar with the math game 24, but not many know about the sequential triad version. You must make each of the following sequences true by only inserting operators and without changing the order of the numbers: 0 1 2 = 24 1 2 3 = 24 2 Read more…

By Chris West, ago
Blog

JavaScript – XOR In Any Base

After writing the Vernam Cipher post, I started thinking about alternatives to using bit-wise XOR in order to translate numbers. I started thinking about XOR for base 3. Therefore I concentrated on what makes XOR so great. What makes XOR stand out from other operators is the fact that assuming Read more…

By Chris West, ago
Blog

JavaScript – Degree & Radian Conversion

Two very simple operations that you may have to deal with if writing a JavaScript that deals with trigonometry are Math.degrees() and Math.radians(). These function can be easily defined as follows: // Converts from degrees to radians. Math.radians = function(degrees) { return degrees * Math.PI / 180; }; // Converts Read more…

By Chris West, ago
Blog

JavaScript – Rounding with Precision

One of the things that bothers me about the native rounding functions is the fact that there is no way to specify precision. If this is something that you need to do you can use the following code to define Math.$round(...), Math.$ceil(...), and Math.$floor(...): (function(arr,i,name) { while(name = arr[i++]) { Read more…

By Chris West, ago
Blog

POW – Multiple Choice Question?

This Problem of the Week will make you question whether or not multiple choice questions really are easier. Here is the question: Assuming the answer can be selected from the following list, if you were to choose one of the following at random, what is the chance that you would Read more…

By Chris West, ago