Why is numpy.random.binomial (1, nan) = -9223372036854775807?

As in the title, I would expect it to be nan too. Is this number special?

+8
python numpy nan
source share
1 answer

This is clearly a bug in numpy.ramdom.binomial .

Is this number special?

I would suggest that this is the result of some calculation involving a raw representation of nan (which is represented as a specific β€œreserved” float value). ( More on this )

The developer probably forgot to check the input for nan and included the raw representation of nan in the calculation (C-level).

+4
source share

All Articles