The isNormal
property of an instance of type double in Swift is used to check if the instance is normal. A normal value is a finite number that uses full precision available to it.
Double.isNormal
The value returned is a boolean. It is true
if the value is normal. Otherwise, false
is returned.
// create double valueslet x1 = 34.444let x2 = 0.0let x3 = 1.2let x4 = Double.infinitylet x5 = -0.555// check if normalprint(x1.isNormal) // trueprint(x2.isNormal) // falseprint(x3.isNormal) // trueprint(x4.isNormal) // falseprint(x5.isNormal) // true