11706 vs ([lno] Canonical iv creation)
Gabriel Dos Reis
gdr@integrable-solutions.net
Sat Mar 13 23:42:00 GMT 2004
Paolo Carlini <pcarlini@suse.de> writes:
[...]
| > (2) Don't use ::pow in std_cmath.h.
| >
| Now I see what you mean ;) You mean, we can use it but only inside a
| specialization
| of __cmath_power<>(_Tp __x, unsigned int __n), basically, inside:
ths is needed only if we need to preserve the symbols.
| > (3) For raising to integer power, please consult
| >
| > http://gcc.gnu.org/ml/gcc-patches/2003-08/msg00160.html
| >
| This is not completely clear to me. Since __builtin_pow* is actually
| quite powerful (and
| precise) in dealing with integral exponent, we can actually use it,
| right? Not as ::pow, not
| inside std_cmath.h, but we can?!?
The point I'm trying to make is that built-ins that raise to integer
exponent are something that have already been discussed with Roger (I
think he implemented, but that ought to be double-checked) and that
the is right place to deal with that. Normally, we should have
double pow(double x, int n) { return __builtin_powi(x, n); }
^
and so on. Note the use use of the built-ins that raises to integer pow.
-- Gaby
More information about the Libstdc++
mailing list