add a Double class to overcome the problems in comparison due to precision loss.