Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
// version 1.1.2
fun stepDown(d: Double) = Math.nextAfter(d, Double.NEGATIVE_INFINITY)
fun stepUp(d: Double) = Math.nextUp(d)
fun safeAdd(a: Double, b: Double) = stepDown(a + b).rangeTo(stepUp(a + b))
fun main(args: Array<String>) {
val a = 1.2
val b = 0.03
println("($a + $b) is in the range ${safeAdd(a, b)}")
}