Sorry I missed the first iteration. You want something like the $T macro, which will substitute source code snippets depending on the $GENERIC type. But by the time you see the PDLs they will have been coerced to a common type, in a vanilla PP routine. I suggest passing the second argument in as an OtherPar of type PDL *. Then you can examine its type explicitly with a switch statement and do what you want.
(Mobile) > On Oct 3, 2015, at 11:00 AM, Chris Marshall <devel.chm...@gmail.com> wrote: > > I don't think it can be done in one PP routine but I can > implement the overload sub so that it uses power for the > non-integer exponent cases and ipow for integer exponents. > > --Chris > >> On 10/2/2015 11:00, Chris Marshall wrote: >> I would like to implement integer exponentiation support for ** that >> is used when the exponent is an integer data type. Unfortunately, I >> can't figure out how to conditionalize the code so that pow is called >> for float type exponent but ipow is called for integer type >> exponents. The generic type info is for the result of the operation >> as a whole and not helpful here. >> >> Suggestions? >> Chris > > > ------------------------------------------------------------------------------ > _______________________________________________ > pdl-devel mailing list > pdl-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pdl-devel >
------------------------------------------------------------------------------
_______________________________________________ pdl-devel mailing list pdl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-devel