GEOS  3.13.0dev
math.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2001-2002 Vivid Solutions Inc.
7  * Copyright (C) 2006 Refractions Research Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************/
15 
16 #pragma once
17 
18 namespace geos {
19 namespace util {
20 
22 double sym_round(double val);
23 
25 double java_math_round(double val);
26 
28 double rint_vc(double val);
29 
30 
35 inline double
36 round(double val)
37 {
38  return java_math_round(val);
39 }
40 
42 double clamp(double x, double min, double max);
43 
44 }
45 } // namespace geos::util
double rint_vc(double val)
Equivalent to Java Math.rint()
double round(double val)
Definition: math.h:36
double java_math_round(double val)
Asymmetric Rounding Algorithm.
double clamp(double x, double min, double max)
Equivalent to std::clamp() in C++17.
double sym_round(double val)
Symmetric Rounding Algorithm.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25