B-58460 Changed long to double for precision, added comments