.less
import Foundation let c = NSNumber(value: Double(42)) let d = NSNumber(value: Double.nan) switch c.compare(d) { case .orderedAscending: print("asc") case .orderedSame: print("same") case .orderedDescending: print("desc") }