I want to be able to generate a random float, double, or integer within a given range.
In order to do that, it helps to make NSNumber conform to the Comparable protocol. This makes it possible to decide whether one of these numbers is smaller, which will be useful later.
My NumberType enumeration has a range and a form…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.