Took errinlarsen's advice and replaced floating point math with BigDecimal Math for precision