Random int64 and float64 numbers

前端 未结 5 1165
失恋的感觉
失恋的感觉 2021-02-14 19:07

I\'m trying to generate random 64-bit integer values for integers and floats using Numpy, within the entire range of valid values for that type. To generate ran

5条回答
  •  攒了一身酷
    2021-02-14 19:18

    It would appear that the code for numpy.random.uniform() does high-low calculation at some point, and the Inf stems from there.

    Uniformly distributed integers are easy to generate as was shown. Uniformly distributed floating point numbers would require rather more careful thought.

    As for reporting these oddities as bugs, I think you should do either that or post a message to the project mailing list. That way you'll at least find out what the developers think is reasonable behaviour.

提交回复
热议问题