I'm not quite sure how to word this question, but perhaps an example will help...
Is there an operator which will show the placement of, say, 25, on a number range from 1-7?
For example:
25/7 returns 4
21/7 returns 7
22/7 returns 1
4/7 returns 4
etc.
Example of code:
var dayOfMonth: Int = 28
var aNumber: Int
aNumber = (dayOfMonth ) % 7
func dayOfTheWeek(day: Int) {
switch day {
case 0:
print("Monday")
case 1:
print("Tuesday")
case 2:
print("Wednesday")
case 3:
print("Thursday")
case 4:
print("Friday")
case 5:
print("Saturday")
case 6:
print("Sunday")
default:
print("Error")
}
}
dayOfTheWeek(day: aNumber)