docstr: The addition method is special for the scaled float, because it
  includes the "cast" between different factors, thus cast-safety
  is influenced by the implementation.
docstr_tok: ["The","addition","method","is","special","for","the","scaled","float",",","because","it","includes","the","``","cast","''","between","different","factors",",","thus","cast-safety","is","influenced","by","the","implementation","."]
code: def test_addition_cast_safety(self):
      """The addition method is special for the scaled float, because it
      includes the "cast" between different factors, thus cast-safety
      is influenced by the implementation.
      """
      a = self._get_array(2.0)
      b = self._get_array(-2.0)
      c = self._get_array(3.0)
  
      # sign change is "equiv":
      np.add(a, b, casting="equiv")
      with pytest.raises(TypeError):
          np.add(a, b, casting="no")
  
      # Different factor is "same_kind" (default) so check that "safe" fails
      with pytest.raises(TypeError):
          np.add(a, c, casting="safe")
  
      # Check that casting the output fails also (done by the ufunc here)
      with pytest.raises(TypeError):
          np.add(a, a, out=c, casting="safe")
  
imports: import pytest
  import numpy
  from numpy.testing import assert_array_equal
  from numpy.core._multiarray_umath import _discover_array_parameters, _get_sfloat_dtype
label_desc: Use image node_id 17 for calling the TestSFloat obj's underlying member method code with example usage: obj.test_addition_cast_safety() without return types