3 ms·
Extremely. In part because the usual exceptional value, -1, is also a valid latitude and longitude.
by raldi 11y ago
Extremely.
In part because the usual exceptional value, -1, is also a valid latitude and longitude.
- ovis 11y agoSure, but why not raise an exception? Or return a separate flag? Or even do something like (999, 999) (clearly not valid, at least for latitude)?
- raldi 11y agoThe 999 idea is good, but as for the other ones, oftentimes this data is recorded in, e.g., a spreadsheet, text file, or vanilla SQL table, so there's no way to throw an exception. You could store something like #N/A or NULL in the bad cells, but a lot of bad code and spreadsheet formulas will interpret that as 0 again, and then we're back where we started.