Blog

EcmaScript 6 – Math.sign()

One function I didn’t think would be doable in most browsers was the Math.sign. My main worry was that on the MDN page it specifies a difference between negative zero and positive zero. After doing some research I found this page which helped me realize there is a way to Read more…

By Chris West, ago
Blog

EcmaScript 6 – Math.hypot()

Many know that JavaScript features vary from browser to browser. In the case of Firefox, there are many new features that have been proposed in EcmaScript 6. One of them is Math.hypot. This function adds up the squares of each argument passed and returns the square-root of that sum. In Read more…

By Chris West, ago
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: The name of these functions indicates the end result. Using the above definitions, you could run code such as 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(...): This code Makes the following functions Read more…

By Chris West, ago