This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new d348d839792 [fix](compile)fix mac compile : std no member numbers
error. (#41075)
d348d839792 is described below
commit d348d83979258f5fca8411ca0d042e70d900049b
Author: daidai <[email protected]>
AuthorDate: Sat Sep 21 18:17:05 2024 +0800
[fix](compile)fix mac compile : std no member numbers error. (#41075)
before pr : #40695
## Proposed changes
Fix the bug that be will have this error when compiling on mac.
```
be/src/vec/functions/math.cpp:416:39: error: no member named 'numbers' in
namespace 'std'
constexpr double sqrt2 = std::numbers::sqrt2;
~~~~~^
1 error generated.
```
---
be/src/vec/functions/math.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/be/src/vec/functions/math.cpp b/be/src/vec/functions/math.cpp
index d7779e7387d..2d9faaf19bc 100644
--- a/be/src/vec/functions/math.cpp
+++ b/be/src/vec/functions/math.cpp
@@ -413,7 +413,12 @@ public:
static bool check_argument(double sd) { return sd > 0; }
static double calculate_cell(double mean, double sd, double v) {
+#ifdef __APPLE__
+ const double sqrt2 = std::sqrt(2);
+#else
constexpr double sqrt2 = std::numbers::sqrt2;
+#endif
+
return 0.5 * (std::erf((v - mean) / (sd * sqrt2)) + 1);
}
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]