[GRASS-dev] G_is_double()

Glynn Clements glynn at gclements.plus.com
Sun Nov 25 14:04:42 EST 2007


Martin Landa wrote:

> I would like to add to the GIS library (strings.c) new fns
> G_is_double(char *str) and G_is_int(char *str). Any objections?

With what definition? E.g. does G_is_double() recognise numbers
without a point? Does it use the locale's decimal separator or always
a dot? Does G_is_int() recognise octal/hex? What about a leading "+"
sign?

Personally, I suggest leaving this to the modules. Otherwise,
whichever syntax you choose, code well tend to use the library
functions regardless of whether their syntax is appropriate for the
specific purpose.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list