MCPcopy Create free account
hub / github.com/numpy/numpy / test_conversions

Method test_conversions

numpy/core/tests/test_simd.py:350–361  ·  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

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

Callers

nothing calls this directly

Calls 3

roundFunction · 0.50
_dataMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected