KASKADE 7 development version
sign.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2002-2011 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef SIGN_HH
14#define SIGN_HH
15
20template <class T>
21T sign(T x)
22{
23 if (x>0) return 1;
24 if (x<0) return -1;
25 return 0;
26}
27
28
29#endif
T sign(T x)
Definition: sign.hh:21