Sign function
(Mylib/Number/sign_function.cpp)
- View this file on GitHub
- Last update: 2021-04-23 23:44:44+09:00
Operations
Requirements
Notes
Problems
References
Code
#pragma once
namespace haar_lib {
template <typename T>
constexpr int sign(T n) {
return (n > 0) - (n < 0);
}
} // namespace haar_lib
#line 2 "Mylib/Number/sign_function.cpp"
namespace haar_lib {
template <typename T>
constexpr int sign(T n) {
return (n > 0) - (n < 0);
}
} // namespace haar_lib