jeudi 25 juin 2015

Generate a random floating point, with no range constraint, but including +inf, -inf, NaN, in python

Python's random number generator allows us to generate a floating point in some range. I wonder how can we generate a floating point number without the range constraint. The random floating point number I want to generate can be NaN, +inf, -inf, or any number in between the minimal and maximal floating point number.

I am looking for a pythonic solution. Thanks.




Aucun commentaire:

Enregistrer un commentaire