Why doesn't 1//0 throw an error?

1//0 being analogous to +Inf doesn’t mean Rational has to comply with IEEE 754, and num and den doesn’t have room for NaNs. Rational also throws an error upon num overflow instead of going to ±Inf (I suppose 1//0 and -1//0 for Rational), and Integer doesn’t (usually) have a negative zero.

1 Like