Fixing floating-point arithmetics with Kotlin

– https://blog.frankel.ch/fixing-floating-point-arithmetics-with-kotlin/ – https://www.linkedin.com/pulse/why-we-should-use-bigdecimal-instead-double-java-financial-ismail val a = 5.8.toBigDecimal() val b = 5.6.toBigDecimal() assertThat(a - b).isEqualTo(0.2.toBigDecimal()) or val a = BigDecimal("5.8") val b = BigDecimal("5.6") assertThat(a - b).isEqualTo(BigDecimal("0.2"))