@nfrankel: if you want absolute precision, starting from a double is already a mistake. valueOf() starts by transforming the double to a string, and then the string to a BigDecimal. You'd better start from a string directly: val d = "0.1".toBigDecimal().