code: def test_int_longdouble_np_regression():
      # Test longdouble conversion from int works as expected
      # Previous versions of numpy would fail, and we used a custom int_to_float()
      # function. This test remains to ensure we don't need to bring it back.
      nmant = type_info(np.float64)["nmant"]
      # test we recover precision just above nmant
      i = 2 ** (nmant + 1) - 1
      assert int(np.longdouble(i)) == i
      assert int(np.longdouble(-i)) == -i
      # If longdouble can cope with 2**64, test
      if nmant >= 63:
          # Check conversion to int; the line below causes an error subtracting
          # ints / uint64 values, at least for Python 3.3 and numpy dev 1.8
          big_int = np.uint64(2**64 - 1)
          assert int(np.longdouble(big_int)) == big_int
  
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 5 for calling a global function with example usage: test_int_longdouble_np_regression() without return types