title: Equivalent of numpy.nan_to_num in C/C++
body: <p>How can I achieve behavior equivalent to numpy's <code>numpy.nan_to_num</code> function in C/C++? </p>
  
  <p>Specificiation for non-python programmers:</p>
  
  <blockquote>
    <p>Replace nan with zero and inf with finite numbers.</p>
    
    <p>Returns an array or scalar replacing Not a Number (NaN) with zero,
    (positive) infinity with a very large number and negative infinity
    with a very small (or negative) number. ... NaN is replaced by
    zero, and infinity (-infinity) is replaced by the largest (smallest or
    most negative) floating point value that fits in the output dtype. </p>
  </blockquote>