code: def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None):
      bounds = ivy.finfo(x.dtype)
      if posinf is None:
          posinf = bounds.max
      if neginf is None:
          neginf = bounds.min
      pos_where = ivy.isinf(x, detect_negative=False)
      neg_where = ivy.isinf(x, detect_positive=False)
      nan_where = ivy.isnan(x)
      ret = ivy.where(nan_where, nan, x)
      ret = ivy.where(pos_where, posinf, ret)
      ret = ivy.where(neg_where, neginf, ret)
      ret = ret.astype(x.dtype, copy=False)
      if not copy:
          return ivy.inplace_update(x, ret)
      return ret
  
file_path: ivy/ivy/functional/frontends/numpy/mathematical_functions/miscellaneous.py
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_casting, handle_numpy_dtype, from_zero_dim_arrays_to_scalar, handle_numpy_out
  from ivy.func_wrapper import with_supported_dtypes
label_desc: Use image node_id 15 for calling a global function with example usage: nan_to_num(x, copy, nan, posinf, neginf) and returns: ret, ivy