Complete Note#1 in the http://wiki.osgeo.org/wiki/GEOS_Provenance_Review to get out...
[geos.git] / include / geos / util / math.h
blob750754a94a3a423b008a707119d56e25e2a94e3e
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2001-2002 Vivid Solutions Inc.
7 * Copyright (C) 2006 Refractions Research Inc.
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.
14 **********************************************************************/
16 #ifndef GEOS_UTIL_MATH_H
17 #define GEOS_UTIL_MATH_H
19 namespace geos { namespace util {
21 /// Symmetric Rounding Algorithm
22 double sym_round(double val);
24 /// Asymmetric Rounding Algorithm
25 double java_math_round(double val);
27 /// Equivalent to Java Math.rint()
28 double rint_vc(double val);
30 /// Default rounding method for GEOS
31 ///
32 /// @note Always use this rounding method, to easy easy switching
33 /// between different rounding method for the whole codebase.
34 inline double round(double val)
36 return java_math_round(val);
39 }} // namespace geos::util
41 #endif // GEOS_UTIL_MATH_H
43 /**********************************************************************
44 * $Log$
45 * Revision 1.4 2006/05/04 14:05:31 strk
46 * * source/headers/geos/util/math.h: provided an util::round() method being an inline proxy to call appropriate default rounding function for the whole GEOS codebase. Currently pointing at util::java_math_round() being the last being used.
48 * Revision 1.3 2006/04/07 12:37:53 mloskot
49 * Added java_math_round() function for Asymmetric Arithmetic Rounding. Small fixes in Unit Tests.
51 * Revision 1.2 2006/04/06 21:30:36 strk
52 * Added missing rint_vc() forward declaration
54 * Revision 1.1 2006/03/09 16:46:49 strk
55 * geos::geom namespace definition, first pass at headers split
57 **********************************************************************/