[postgis-users] fabs() testing for y-coordinates in lwgeom_svg.c

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Thu Nov 20 03:29:50 PST 2008


Klaus Förster wrote:

> yes Mark, I know that the axis is reversed, but I don't get the point 
> why the if clause is needed: fabs(pt->y) always returns a positive value 
> or 0 and multiplying 0 with -1 doesn't do any harm. So why not use 
> sprintf(y, "%.*f", precision, pt->y * -1) and skip the test?
> 
> Klaus


Hi Klaus,

In that case I don't know - the original patch was submitted by Eduin 
Carillo so he would be the right person to ask. The only thing I can 
think of is that it is supposed to suppress "minus 0" from appearing in 
the KML output (as +/- 0 are separate numbers in IEEE-754 floating point 
numbers), but even then I'm not 100% convinced by the logic.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-users mailing list