Inf doesnât have any computational benefits for rationals, for a series of calculations, since no calculation will produce such, unless you start with Inf (and why would you want them in your input data?).
Iâm totally fine with the âincoherent policyâ, since also neither is obviously better, throwing an error or propagating it. I can see it bad NOT stopping right away, imagine spending lots of power, time, on a supercomputer, then seeing NaN
s (or Inf
where it applies; for IEEE).
For debugging, I guess running to the end, then checking for them could be helpful (or looking for a needle in a haystack).
The good thing about Julia is that none of the built-in types have much advantage over types in a package (other than being the go-to type), so you can make your own rational type with signaling properties.
NaN
s in IEEE were meant to be signaling, carrying a payload (Inf
s do not, only having one bit-pattern, for each, Inf and -Inf), I guess helpful to point to where the error happened IF implemented, but no language (or at least major one) does it by default (or even as opt in, that I know of), so I donât see it as very helpful to get NaN
s in the end. But the IEEE float code will be faster not having to check at runtime and have (precise) exceptions.
While I was wrong on 2//0 having a different bit-pattern than 1//0, both meaning Inf, that would be conceivable and the different number being a payload, but then only possible for Inf
s as opposed to NaNs (and IEEE), which rationals donât have, nor an easy way to addâŠ