Skip to content

Commit

Permalink
fix abs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashleyhx committed Sep 20, 2023
1 parent b58a306 commit c8ca29e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/include/function/arithmetic/arithmetic_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ struct Negate {
struct Abs {
template<class T>
static inline void operation(T& input, T& result) {
result = abs(input);
if constexpr (std::is_unsigned_v<T>) {
result = input;
} else {
result = abs(input);
}
}
};

Expand Down

0 comments on commit c8ca29e

Please sign in to comment.