Use 'num1' as a comparison reference to determine if num2 or num3 are zero. Did it successfully in Objective-C, and I'm trying to do it in Swift:
let num1: NSDecimalNumber = NSDecimalNumber.zero()
let num2: NSDecimalNumber = NSDecimalNumber.decimalNumberWithString("0")
let num3: NSDecimalNumber = NSDecimalNumber.decimalNumberWithString("0.000001")
if num1.compare(num2) == NSOrderedSame {
println("They match")
}
This attempt results in: "error: use of unresolved identifier" NSOrderedSame "". What is the correct way to achieve this in Swift? (Look for the book and the web, but something is missing, perhaps the obvious, thanks).
source
share