GEOS 3.14.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
18namespace geos {
19namespace util {
20
22double sym_round(double val);
23
25double java_math_round(double val);
26
28double rint_vc(double val);
29
30
35inline double
36round(double val)
37{
38 return java_math_round(val);
39}
40
42double 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 geos.h:39