negative inf in python code example
Example 1: python negative infinity
float('-inf')
Example 2: convert negative to positive in python
>>> n = -42
>>> -n # if you know n is negative
42
>>> abs(n) # for any n
42
>>> abs(-5.05)
5.05
float('-inf')
>>> n = -42
>>> -n # if you know n is negative
42
>>> abs(n) # for any n
42
>>> abs(-5.05)
5.05