This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ::pow(T, n) vs std::pow(T, n) for non-constant n


Gabriel Dos Reis wrote:
Richard Guenther <rguenth@tat.physik.uni-tuebingen.de> writes:

| exponent.  This is why I suggest for __builtin_pow not to dispatch to
| the library for non-const arguments, but to an internal routine
| modeled after the v3 binary algorithm.

There definitely should be a __builtin_powi() and the like.  But I
don't like that std::pow(, 4) and std::pow(, n) (with n == 4) should
give different results.

With -ffast-math this would be acceptable. But I don't like std::pow(x, n) and ::pow(x, n) to differ either. One could improve the binary v3 algorithm with a table dispatch to optimal code for exponents < 256 like the builtin function does.


Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]