Maximum and Minimum values for ints

前端 未结 9 1905
北荒
北荒 2020-11-22 06:36

I am looking for minimum and maximum values for integers in python. For eg., in Java, we have Integer.MIN_VALUE and Integer.MAX_VALUE. Is there som

9条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 07:01

    You may use 'inf' like this:

    import math
    bool_true = 0 < math.inf
    bool_false = 0 < -math.inf
    

    Refer: math — Mathematical functions

提交回复
热议问题