code: def test_best_float():
      # Finds the most capable floating point type
      """most capable type will be np.longdouble except when
  
      * np.longdouble has float64 precision (MSVC compiled numpy)
      * machine is sparc64 (float128 very slow)
      * np.longdouble had float64 precision when ``casting`` moduled was imported
       (precisions on windows can change, apparently)
      """
      best = best_float()
      end_of_ints = np.float64(2**53)
      # float64 has continuous integers up to 2**53
      assert end_of_ints == end_of_ints + 1
      # longdouble may have more, but not on 32 bit windows, at least
      end_of_ints = np.longdouble(2**53)
      if (
          end_of_ints == (end_of_ints + 1)
          or machine() == "sparc64"  # off continuous integers
          or longdouble_precision_improved()  # crippling slow longdouble on sparc
      ):  # Windows precisions can change
          assert best == np.float64
      else:
          assert best == np.longdouble
  
file_path: nibabel/nibabel/tests/test_casting.py
imports: import os
  from platform import machine
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ..casting import CastingError, able_int_type, best_float, float_to_int, floor_log2, int_abs, longdouble_precision_improved, sctypes, shared_range, ulp
  from ..testing import suppress_warnings
label_desc: Use image node_id 8 for calling a global function with example usage: test_best_float() without return types