Skip to content

Commit 9ab852e

Browse files
fix of divmod, divmodf
1 parent 76db89d commit 9ab852e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mkl_umath/src/loops_intel.c.src

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static inline npy_float spacingf(npy_float x) {
122122
}
123123

124124
static inline npy_double divmod(npy_double x1, npy_double x2, npy_double *mod) {
125+
fesetround(FE_DOWNWARD);
125126
npy_double q = rint(x1 / x2);
126127

127128
*mod = x1 - q * x2;
@@ -130,6 +131,7 @@ static inline npy_double divmod(npy_double x1, npy_double x2, npy_double *mod) {
130131
}
131132

132133
static inline npy_float divmodf(npy_float x1, npy_float x2, npy_float *mod) {
134+
fesetround(FE_DOWNWARD);
133135
npy_float q = rintf(x1 / x2);
134136

135137
*mod = x1 - q * x2;

0 commit comments

Comments
 (0)