## 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…

## 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…

## JavaScript – Pseudo Array Comprehensions

In my job I have recently switched over to primarily coding in Python and I am loving the change. One thing that I find interesting is list comprehensions. Still, since my first love is JavaScript, I wanted to be able to do something similar in JavaScript and had remembered coming Read more…

###### Math

Here is the answer to last week’s POW: (0! + 1 + 2)! = 24 (-1 + 2 + 3)! = 24 2 * 3 * 4 = 24 (3 – 4 + 5)! = 24 4! / (-5 + 6) = 24 (5 + 6 – 7)! = 24 Read more…

## 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…

## 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…

## JavaScript – Simple Vernam Cipher

If you have ever taken an encryption class, I am sure that you have heard of the Vernam Cipher. For fun today I decided to write a quick one in JavaScript which takes your message and the random key: To you use this function you must supply both a message Read more…

## 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…

## 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…