failing test for kt-475

This commit is contained in:
Alex Tkachman
2011-11-12 20:51:19 +02:00
parent a322154477
commit a3ac4506af
2 changed files with 18 additions and 0 deletions
@@ -0,0 +1,14 @@
import java.math.BigDecimal
fun box() : String {
// Easy to make BigDecimals user-friendly
System.out?.println(
"2.00".bd - "1.00"
)
return "OK"
}
val String.bd = BigDecimal(this)
fun BigDecimal.minus(other : BigDecimal) = this.subtract(other)
fun BigDecimal.minus(other : String) = subtract(other.bd) // this can be omitted