Functions
math_utils.hpp File Reference

Math utilities. More...

Go to the source code of this file.

Functions

template<typename T >
int sgn (T val)
 Return the sign of the given value (-1, 0 or +1). More...
 

Detailed Description

Math utilities.

Author
Martin Pecka SPDX-License-Identifier: BSD-3-Clause SPDX-FileCopyrightText: Czech Technical University in Prague

Definition in file math_utils.hpp.

Function Documentation

◆ sgn()

template<typename T >
int sgn ( val)
inline

Return the sign of the given value (-1, 0 or +1).

Template Parameters
TType of the number.
Parameters
valThe value to get sign of.
Returns
Sign of the value: -1 for negative, 0 for 0, +1 for positive numbers.

Definition at line 17 of file math_utils.hpp.



cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Dec 14 2024 03:51:04