Skip to content
Snippets Groups Projects
Commit 310abc69 authored by Adrian Burri's avatar Adrian Burri
Browse files

Added sign function

[[Imported from SVN: r3672]]
parent b90c065e
No related branches found
No related tags found
No related merge requests found
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef MISC_HH
#define MISC_HH
/** \file
\brief Miscellaneous helper stuff
*/
#ifndef MISC_HH
#define MISC_HH
#include <iostream>
#include <sstream>
......@@ -35,6 +35,13 @@ namespace Dune {
@{
*/
//! Return the sign of the value
template <class T>
int sign(const T& val)
{
return (val < 0 ? -1 : 1);
}
/** \brief Compute the square of T */
template<class T>
T SQR (T t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment