When architecture is 32 bit then CGFloat is Float.
In this case I would like to invoke rintf()
When architecture is 64 bit then CGFloat is Double.
In this case I would like to invoke rint()
I currently do a cast to Double and then invoke rint()
func roundToNearestCell(coordinate: CGFloat) -> CGFloat {
let cellSize = 10.0
return cellSize * CGFloat(rint(Double(coordinate / cellSize)))
}
Perhaps generics can handle both cases nicely?