MCPcopy Index your code
hub / github.com/numpy/numpy / test_conversions

Method test_conversions

numpy/_core/tests/test_simd.py:356–367  ·  view source on GitHub ↗

Round to nearest even integer, assume CPU control register is set to rounding. Test intrinsics: npyv_round_s32_##SFX

(self)

Source from the content-addressed store, hash-verified

354 To only test double precision
355 """
356 def test_conversions(self):
357 """
358 Round to nearest even integer, assume CPU control register is set to rounding.
359 Test intrinsics:
360 npyv_round_s32_##SFX
361 """
362 vdata_a = self.load(self._data())
363 vdata_a = self.sub(vdata_a, self.setall(0.5))
364 vdata_b = self.mul(vdata_a, self.setall(-1.5))
365 data_round = [round(x) for x in list(vdata_a) + list(vdata_b)]
366 vround = self.round_s32(vdata_a, vdata_b)
367 assert vround == data_round
368
369class _SIMD_FP(_Test_Utility):
370 """

Callers

nothing calls this directly

Calls 3

roundFunction · 0.50
_dataMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected