home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!psgrain!qiclab!leonard
- From: leonard@qiclab.scn.rain.com (Leonard Erickson)
- Subject: Re: powers in TURBO pascal
- Message-ID: <1992Dec31.122326.7404@qiclab.scn.rain.com>
- Reply-To: Leonard.Erickson@f51.n105.z1.fidonet.org
- Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
- References: <30DEC92.02825818.0033@music.mus.polymtl.ca> <dmurdoch.262.725736007@mast.queensu.ca> <1992Dec30.174246.2523@news.uni-stuttgart.de>
- Date: Thu, 31 Dec 1992 12:23:26 GMT
- Lines: 26
-
- lehnert@ifsws1.sozialforschung.uni-stuttgart.de (Doris Lehnert) writes:
-
- >Hi, everybody,
- >I suppose it's trivial, but ...
-
- >What is the TURBO pascal operator for "x to the power of y"?
-
- >I tried ^ (reserved for pointers), **, and others,
- >and consulted the Borland Reference Books;
- >Maybe somebody can help me.
-
- There *isn't* a power operator in Turbo Pascal. You see, Pascal as defined
- in the standard has no such operator. So it would be an extension of
- the standard, and they chose not to do it.
-
- You'll have to write your own function:
-
- Function Power(a,b:real):real;
- begin
- {messy code goes here!}
- end;
- --
- Leonard Erickson leonard@qiclab.scn.rain.com
- CIS: [70465,203] 70465.203@compuserve.com
- FIDO: 1:105/51 Leonard.Erickson@f51.n105.z1.fidonet.org
- (The CIS & Fido addresses are preferred)
-