Skip to content

Commit 3538e4a

Browse files
committed
Handle overloading of fmax/fmin
1 parent 7e1585b commit 3538e4a

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

ADDFUNCS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Example:
5454
#define FUNC_FF(...)
5555
#endif
5656
...
57-
FUNC_FF(FUNC_MYFUNC_FF, "myfunc_ff", myfuncf, myfuncf2, vfMyfunc)
57+
FUNC_FF(FUNC_MYFUNC_FF, "myfunc_ff", myfuncf, myfuncf2, vsMyfunc)
5858
FUNC_FF(FUNC_FF_LAST, NULL, NULL, NULL, NULL)
5959
#ifdef ELIDE_FUNC_FF
6060
#undef ELIDE_FUNC_FF

numexpr/functions.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ FUNC_DDD(FUNC_ARCTAN2_DDD, "arctan2_ddd", atan2, vdAtan2)
140140
FUNC_DDD(FUNC_HYPOT_DDD, "hypot_ddd", hypot, vdHypot)
141141
FUNC_DDD(FUNC_NEXTAFTER_DDD, "nextafter_ddd", nextafter, vdNextAfter)
142142
FUNC_DDD(FUNC_COPYSIGN_DDD, "copysign_ddd", copysign, vdCopySign)
143-
FUNC_DDD(FUNC_MAXIMUM_DDD, "maximum_ddd", fmax, vdFmax)
144-
FUNC_DDD(FUNC_MINIMUM_DDD, "minimum_ddd", fmin, vdFmin)
143+
FUNC_DDD(FUNC_MAXIMUM_DDD, "maximum_ddd", fmaxd, vdFmax)
144+
FUNC_DDD(FUNC_MINIMUM_DDD, "minimum_ddd", fmind, vdFmin)
145145
FUNC_DDD(FUNC_DDD_LAST, NULL, NULL, NULL)
146146
#ifdef ELIDE_FUNC_DDD
147147
#undef ELIDE_FUNC_DDD

numexpr/msvc_function_stubs.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#define hypotf(x, y) ((float)hypot((double)(x), (double)(y)))
4545
#define copysignf(x, y) ((float)copysign((double)(x), (double)(y)))
4646
#define nextafterf(x, y) ((float)nextafter((double)(x), (double)(y)))
47-
#define fmaxf(x, y) ((float)fmax((double)(x), (double)(y)))
48-
#define fminf(x, y) ((float)fmax((double)(x), (double)(y)))
47+
#define fmaxf(x, y) ((float)fmaxd((double)(x), (double)(y)))
48+
#define fminf(x, y) ((float)fmind((double)(x), (double)(y)))
4949
#define ceilf(x) ((float)ceil((double)(x)))
5050
#define hypotf(x) ((float)hypot((double)(x)))
5151
#define rintf(x) ((float)rint((double)(x)))

numexpr/numexpr_config.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
#include <cmath>
4444
//no single precision version of signbit in C++ standard
4545
inline bool signbitf(float x) { return signbit((double)x); }
46+
// To handle overloading of fmax/fmin in cmath
47+
inline double fmaxd(double x, double y) { return fmax(x, y); }
48+
inline double fmind(double x, double y) { return fmin(x, y); }
4649
#ifdef _WIN32
4750
#ifndef __MINGW32__
4851
#include "missing_posix_functions.hpp"

0 commit comments

Comments
 (0)