When the expected number of events is negative, return a NaN instead of 0.
When the expected number of events is negative, return a NaN instead of 0.

This fixes #8011

olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root,olifre/root