How to get a floating point infinity that when multiplied by zero gives zero

Viewed 2162

How do I get a "small enough" infinity that its product with zero is zero?

I'm using an integer programming solver for Python, and some of my variables have infinite cost. I can't use float('inf') because float('inf')*0 = NaN

3 Answers
Related