Path: utzoo!attcan!uunet!decwrl!sdd.hp.com!hplabs!otter.hpl.hp.com!otter!phmb From: phmb@otter.hpl.hp.com (Peter Brooks) Newsgroups: comp.lang.pascal Subject: Re: TP: Exponentiation? Message-ID: <750001@otter.hpl.hp.com> Date: 31 Jul 90 07:12:53 GMT References: <950036@hpclapd.HP.COM> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 29 >In the new Extended Pascal standard (already approved by ANSI, IEEE, & BSR), >the Pascal committee has added exponentiation to the language. As a matter >of fact, we added TWO operators. We added "**" for raising things to >real powers and "POW" for raising things to integer powers. All well and good, but what if the result is complex? In order for the standard to be of use, Pascal ought to have a complex type and the above operators ought to return range/domain error if an attempt is made to return a complex to a real. In TP, the problem is compounded since the function will not return a record, so even if you code a correct function returning you home rolled complex record, it won't compile. I think that Borland is encouraging you to either write a macro pre-processor to expand '**' or '^' into in-line code before giving it to TP (not too difficult vide software tools in Pascal) or to modify a global. I cannot believe that any blue blooded Pascal adherent would feel anything other than a chill of horror at the thought of modifying a global (or perhaps a childhood memory of FORTRAN [child abuse of the mind]) so this must mean that Borland expects us to write macros. The question for Borland is then; where are the clips, stubs or hooks to allow us to integrate our pre-processors into turbo.exe or tpc.exe? My HP-28C happily returns the right result, changing into the complex domain when required. The only little gripe is that it isn't possible to set it to a mode where complex is the default ( why not hex, oct, dec, real, complex ?). Peter Brooks