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

Function rational_ufunc_test_add

numpy/core/src/umath/_rational_tests.c:1069–1082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067
1068
1069static void
1070rational_ufunc_test_add(char** args, npy_intp const *dimensions,
1071 npy_intp const *steps, void* data) {
1072 npy_intp is0 = steps[0], is1 = steps[1], os = steps[2], n = *dimensions;
1073 char *i0 = args[0], *i1 = args[1], *o = args[2];
1074 int k;
1075 for (k = 0; k < n; k++) {
1076 npy_int64 x = *(npy_int64*)i0;
1077 npy_int64 y = *(npy_int64*)i1;
1078 *(rational*)o = rational_add(make_rational_fast(x, 1),
1079 make_rational_fast(y, 1));
1080 i0 += is0; i1 += is1; o += os;
1081 }
1082}
1083
1084
1085static void

Callers

nothing calls this directly

Calls 2

rational_addFunction · 0.85
make_rational_fastFunction · 0.85

Tested by

no test coverage detected