SLIDE  3.0.0
A simulator for lithium-ion battery pack degradation
Loading...
Searching...
No Matches
predicate_functions.hpp
Go to the documentation of this file.
1/*
2 * predicate_functions.cpp
3 *
4 * Predicate functions to help to write everything shorter.
5 *
6 * Created on: 07 Apr 2022
7 * Author(s): Jorn Reniers, Volkan Kumtepeli
8 */
9
10#pragma once
11
12namespace slide::util {
13template <typename T>
14constexpr auto is_zero(T x)
15{
16 return x == 0;
17}
18
19template <typename T>
20constexpr int sign(T x)
21{
22 return (x > T(0)) - (x < T(0));
23}
24
25} // namespace slide::util
Definition: predicate_functions.hpp:12
constexpr auto is_zero(T x)
Definition: predicate_functions.hpp:14
constexpr int sign(T x)
Definition: predicate_functions.hpp:20