Hi Jerome (and bug-gsl added on CC),

> I have just gone through some gsl_(vector|matrix)_TYPE.h headers (with
> TYPE=long, long_double, ...). Functions that scale by or add a
> constant has a *double* as constant argument: should this argument
> constant not be in type TYPE rather than in type double?

Just to be concrete, you're saying all of

int gsl_vector_long_double_scale (gsl_vector_long_double * a, const double x);
int gsl_vector_long_double_add_constant (gsl_vector_long_double * a,
const double x);
int gsl_matrix_long_double_scale (gsl_matrix_long_double * a, const double x);
int gsl_matrix_long_double_add_constant (gsl_matrix_long_double * a,
const double x);
int gsl_matrix_long_double_add_diagonal (gsl_matrix_long_double * a,
const double x);

should be taking long doubles as their second argument?  Likewise for
other types?  I agree.

For anything "smaller" than double I doubt that the bug will cause a
loss of precision.  But for long doubles and above it is indeed a
problem.  Either way, the API isn't right.

Anyone have an objection if I throw this in a ticket on savannah and
take a stab at fixing it by correcting the templating?  (I think the
right template macro is BASE rather than TYPE, but that's an
implementation detail).

- Rhys

Reply via email to