code: def test_check_nmant_nexp():
      # Routine for checking number of sigificand digits and exponent
      for t in IEEE_floats:
          nmant = np.finfo(t).nmant
          maxexp = np.finfo(t).maxexp
          assert _check_nmant(t, nmant)
          assert not _check_nmant(t, nmant - 1)
          assert not _check_nmant(t, nmant + 1)
          with suppress_warnings():  # overflow
              assert _check_maxexp(t, maxexp)
          assert not _check_maxexp(t, maxexp - 1)
          with suppress_warnings():
              assert not _check_maxexp(t, maxexp + 1)
      # Check against type_info
      for t in ok_floats():
          ti = type_info(t)
          if ti["nmant"] not in (
              105,
              106,
          ):  # This check does not work for PPC double pair
              assert _check_nmant(t, ti["nmant"])
          # Test fails for longdouble after blacklisting of OSX powl as of numpy
          # 1.12 - see https://github.com/numpy/numpy/issues/8307
          if t != np.longdouble or sys.platform != "darwin":
              assert _check_maxexp(t, ti["maxexp"])
  
file_path: nibabel/nibabel/tests/test_floating.py
imports: import sys
  from contextlib import nullcontext
  import numpy
  import pytest
  from packaging.version import Version
  from ..casting import FloatingError, _check_maxexp, _check_nmant, ceil_exact, floor_exact, floor_log2, have_binary128, longdouble_precision_improved, ok_floats, on_powerpc, sctypes, type_info
  from ..testing import suppress_warnings
label_desc: Use image node_id 4 for calling a global function with example usage: test_check_nmant_nexp() without return types