onekiloparsec / SwiftAA

The most comprehensive collection of accurate astronomical algorithms in (C++, Objective-C and) Swift.
http://www.onekiloparsec.dev/
MIT License
172 stars 31 forks source link

Determine best strategy for sexagesimal input validation #49

Closed onekiloparsec closed 7 years ago

onekiloparsec commented 7 years ago

See Numeric types constructors.

onekiloparsec commented 7 years ago

Done for Hour and Degree. Not sure it is the best, but at least, it handles correctly the 0 too.

onekiloparsec commented 7 years ago

Well, it doesn't precisely "handle correctly the 0 too", it normalises the input to a meaningful value, even if input isn't entirely consistent (for instance, different signs in minutes, seconds etc). Anyway.