Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift ui check if number is a prime

func isPrime(_ number: Int) -> Bool {
    return number > 1 && !(2..<number).contains { number % $0 == 0 }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #ui #check #number #prime
ADD COMMENT
Topic
Name
9+4 =