I've just noticed that KAPPA parget does not give you double precision
numbers from _DOUBLE parameters. They seem to be _REAL precision. Looking
at parget.f this seems to be because dat_get1c is used. HDS seems to be
doing:
dat1_cvt_char:
case DAT__R:
(void) sprintf( buffer, "%G""%n", *((_REAL *) src.body),
&nchar );
break;
case DAT__D:
(void) sprintf( buffer, "%G""%n", *((_DOUBLE *) src.body),
&nchar );
break;
which means that Double and real both convert to %6G (The default).
Shouldn't it be doing what AST does:
sprintf( setting, "ObsLon(%d)=%.*g", i + 1, DBL_DIG, lambda*AST__DR2D );
ie
case DAT__R:
(void) sprintf( buffer, "%G""%n", *((_REAL *) src.body),
&nchar );
break;
case DAT__D:
(void) sprintf( buffer, "%.*G%n", DBL_DIG,*((_DOUBLE *) src.body),
&nchar );
break;
?
(and making the above change does actually lead to PARGET giving me the
double precision value). Is the fear that the added precision will lead to
buffer overflows? In that case I'd have to patch parget to do a get1D
instead of get1c in the special case.
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|