diff options
| author | Ganesh Kathiresan <ganesh3597@gmail.com> | 2021-04-13 21:09:12 +0530 |
|---|---|---|
| committer | Sayed Adel <seiko@imavr.com> | 2021-05-20 23:19:50 +0200 |
| commit | b1c3c98bfa13699dda51642723e3ce849d5950eb (patch) | |
| tree | 272749fe093a9d2d3e1eafec7fbd0438b5e14d24 /numpy | |
| parent | 0b8838ef0c2e4c5d9e66163d260dc30902cc6170 (diff) | |
| download | numpy-b1c3c98bfa13699dda51642723e3ce849d5950eb.tar.gz | |
DOC: Added floor divide doc
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/umath/loops_arithmetic.dispatch.c.src | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/core/src/umath/loops_arithmetic.dispatch.c.src b/numpy/core/src/umath/loops_arithmetic.dispatch.c.src index 55066589f..30d7a2a99 100644 --- a/numpy/core/src/umath/loops_arithmetic.dispatch.c.src +++ b/numpy/core/src/umath/loops_arithmetic.dispatch.c.src @@ -20,6 +20,19 @@ //############################################################################### /******************************************************************************** ** Defining the SIMD kernels + * + * Floor division of signed is based on T. Granlund and P. L. Montgomery + * “Division by invariant integers using multiplication(see [Figure 6.1] + * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.1.2556)" + * For details on TRUNC division see simd/intdiv.h for more clarification + *********************************************************************************** + ** Figure 6.1: Signed division by run–time invariant divisor, rounded towards -INF + *********************************************************************************** + * For q = FLOOR(a/d), all sword: + * sword −dsign = SRL(d, N − 1); + * uword −nsign = (n < −dsign); + * uword −qsign = EOR(−nsign, −dsign); + * q = TRUNC((n − (−dsign ) + (−nsign))/d) − (−qsign); ********************************************************************************/ #if NPY_SIMD /**begin repeat |
