This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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] | |
Hi, Tobi, Paul, etc
I missed the discussion because of my poor modem. But I have implemented this
and the patch is under test. IMHO, we have to implement the algorithm described
by Knuth in the FE. BUILT_IN_POW only deals with Real type. How about complex
type? There are also many problems to consider when an integer is raised to an
negative integer. The result is just 0, -1, or 1. So it is not correct to
convert integer to real.
I think we should also implement the runtime library function powi. When a value is raised to an varible integer, we just call the library function. The value may be of integer type, real type or complex type.
I have done these and in a few days I will give the patch. I didn't port Andy's implementation. Andy's vertion only deal with exponent under 100 and don't consider (integer ** negative integer). The main algorithm in my implementation is from builtins.c and can deal with an arbitrary integer exponent. The algorithm in powi library function is from libf77.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |