[geos-devel] Is this symmetric rounding algorithm?

strk at refractions.net strk at refractions.net
Mon Feb 27 13:23:50 EST 2006


For archive's sake: I've added your functions to util/math.cpp
renamed to sym_round in 'util' namespace.

--strk;

 State-collected Geographic Data is public property !
 European citizens, reject the INSPIRE directive.
 Sign the petition: http://petition.publicgeodata.org

On Fri, Feb 24, 2006 at 03:26:29PM +0100, Mateusz Å?oskot wrote:
> Mateusz Łoskot wrote:
> >
> >    printf("--- rint -------------------\n");
> >    printf("x:   %f \n", rint_vc(x));
> >    printf("x1: %f \n", rint_vc(x1));
> >    printf("y:   %f \n", rint_vc(y));
> >    printf("y1: %f \n", rint_vc(y1));
> 
> rint_vc is taken from geom\PrecisionModel.cpp file.
> 
> What I call symmetric rounding is:
> 
> Positive values +5.5 and +6.5 round up to +6 and +7.
> So, negative equivalents of -5.5 and -6.5 should round (down) to -6 and -7.
> 
> 
> Cheers
> -- 
> Mateusz Łoskot
> http://mateusz.loskot.net




More information about the geos-devel mailing list