9 ms·
Floating-point infinity is actually really useful in Python because you can easily and efficiently compare it to Python's arbitrary-size integers.
by zahlman 8mo ago
Floating-point infinity is actually really useful in Python because you can easily and efficiently compare it to Python's arbitrary-size integers.
- cogman10 8mo agoFor what purpose? When does this come up? I can also compare infinity to Java's BigDecimal values but I fail to see what I'd want to or need to.
- zahlman 8mo agoHaving data-driven code to check if a value is in bounds, and sometimes wanting the bounds to be open on either or both sides. Also: creating an efficient sort key.