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
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
Blog

JavaScript – Euclidean Algorithm

One of the things that you often have to learn early on in school after multiplication and division is how to find the GCD (Greatest Common Divisor) of two numbers. It is possible that you know the GCD as the GCF (Greatest Common Factor) or the HCF (Higest Common Factor). Read more…

By Chris West, ago