[GRASS-dev] Re: [GRASS GIS] #1161: g.region and r.info decimel
issue when using grass python libs
GRASS GIS
trac at osgeo.org
Sun Oct 3 18:37:36 EDT 2010
#1161: g.region and r.info decimel issue when using grass python libs
-------------------------+--------------------------------------------------
Reporter: isaacullah | Owner: grass-dev@…
Type: defect | Status: closed
Priority: normal | Milestone: 6.4.1
Component: Python | Version: 6.4.0
Resolution: invalid | Keywords:
Platform: All | Cpu: All
-------------------------+--------------------------------------------------
Comment(by hamish):
Replying to [comment:6 glynn]:
> Given that coordinates are limited by the circumference of the earth,
> both %.15g and %.8f should be converted without loss (i.e. adjacent
> values should have distinct floating-point representations), so if
> you format as decimal with the correct number of digits, you should
> get the original value. This has to be done when you convert to decimal,
> though; you can't "tag" floating-point values with formatting options.
note that for lat/lon you'll need to go to %.12g or so.
I guess what I find weird is that g.region will never report with
precision > .15g, which is exactly representable & will never saturate the
double-prec bitspace, and so the python repr() example above is perhaps
using %.16f internally?
{{{
echo 5.1 | awk '{printf("%.16f\n", $1)}'
}}}
?,
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1161#comment:8>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list