Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These are not the only alternatives. E.g.:

- introduce a non-zero number type, define division as Number/NonZeroNumber -> Number, and provide a simple, non-verbose way to convert a Number into NonZeroNumber (with default value in case of zero, and/or direct assignment after a non-zero-check)

- optionally introduce an unsafe division operator that takes two Numbers and returns Option[Number]



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: