val (/) : int -> (divisor:int { divisor <> 0 }) -> intThere's no viable way to statically prove at compile-time that these variables will never become zero at runtime, ultimately forcing a system of endless runtime checks (be it software or hardware)... which is why processors already throw exception interrupts when division by zero is attempted.
An alternative https://en.wikipedia.org/wiki/Projectively_extended_real_lin...
The projectively extended real line defines division by zero, no reason you couldn't have a floating point type that implemented it.
>There's no viable way to statically prove at compile-time that these variables will never become zero at runtime
strongly typed programming languages like Ada allow for types which have ranges such as disallowing zero -- but also any arbitrary thing like you can create a floating point "degrees" type which is [0.0, 360.0] or any other ranged type
Int / 0 -> DivisionByZeroError
PositiveInt / PositiveInt -> PositiveFloat
PositiveInt / NegativeInt -> NegativeFloat
NegativeInt / PositiveInt -> NegativeFloat
NegativeInt / NegativeInt -> PositiveFloat
And the type signatures of those possible return values can drive validation checks upstream of the calculation, so you're not actually ever going to return DivisionByZeroError. You're making sure through validation checks or case logic that that can never be returned.