home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7767 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.3 KB  |  38 lines

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