[Proj] Proj4 Bug (rtodms)
Frank Warmerdam
warmerdam at pobox.com
Thu Nov 2 07:16:12 PST 2006
cp wrote:
> due to floating point precision, there is a bug in source code of rtodms.c
>
> the portion of code
>
> r = floor(r * CONV + .5);
> sec = fmod(r / RES, 60.);
> r = floor(r / RES60);
> min = fmod(r, 60.);
> deg = r / 60.;
>
> must be replaced by
>
> r = floor(r * CONV + .5);
> sec = fmod(r / RES, 60.);
> r = floor(r / RES60);
> min = fmod(r, 60.);
> r = floor(r / 60.);
> deg = r;
>
> the conversion of 0.06981317007977319578 (4 degree in radian) is 3d with
> the first code (wrong) and 4d with the second (true).
"cp",
I have applied your patch in CVS.
Thanks,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
More information about the Proj
mailing list