There is no integer inf or nan value.  So they aren't an option when the output is an integer array.  0 seems as good an arbitrary value as anything.  I suppose MAXINT would be another (equally poor, imo) option they could have picked.