JavaのDouble.isNan()はないので、KotlinのDoubleの拡張メソッドを使う。Floatも同様。
if (num == Double.NaN || num === Double.NaN) {
// never
}
if (num.isNaN()) {
// num is not-a-number
}
Go to list of users who liked
More than 5 years have passed since last update.
JavaのDouble.isNan()はないので、KotlinのDoubleの拡張メソッドを使う。Floatも同様。
if (num == Double.NaN || num === Double.NaN) {
// never
}
if (num.isNaN()) {
// num is not-a-number
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked