Archive for March, 2009

Simple Way to Compute Median in Java

There is no way that I know of to find the median of a list of numbers in the Java framework. The median is the middle value. If there is an even number of values, the median is the middle of these two numbers. Below is a method, along with a supporting method and some [...] Read more »

Perform Log Base 2 Transformation in Java

Java has functionality built into it to transform a number using the natural logarithm. This can be done using the java.util.Math.log() method. However, to my knowledge there is no way to do this for base-2 logarithms.
Please don’t let me get started on how silly this is!!
To do a base-2 log transformation:

public static double [...] Read more »