CustusX  18.04
An IGT application
cxMathUtils.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #include "cxMathUtils.h"
13 namespace cx {
14 double roundAwayFromZero(double val)
15 {
16  if(val >= 0)
17  return int(val+0.5);
18  else
19  return int(val-0.5);
20 }
21 
22 unsigned int roundUnsigned(double val)
23 {
24  return int(val+0.5);
25 }
26 
27 
28 }
double roundAwayFromZero(double val)
Definition: cxMathUtils.cpp:14
unsigned int roundUnsigned(double val)
Definition: cxMathUtils.cpp:22
Namespace for all CustusX production code.