How can I test if a value of type Double in Kotlin is not
Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.NaN
or some other special value?
I'd like to have something like require(Double.isNormal(x))
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/is-finite.html
require(x.isFinite())
is what you need.