ENH: some checking for NaNs,
     should work now if func is only defined for positive arguments