Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!uokmax!d.cs.okstate.edu!drd!mike From: mike@DRD.Com (Mike Rovak) Newsgroups: comp.lang.pascal Subject: Re: TP: Exponentiation? Message-ID: <1990Jul27.162710.25312@DRD.Com> Date: 27 Jul 90 16:27:10 GMT References: <950036@hpclapd.HP.COM> <1256@cnps.PHILIPS.nl> Reply-To: mike@drd.Com (Mike Rovak) Followup-To: comp.lang.pascal Organization: DRD Corporation, Tulsa, OK Lines: 29 jeroenk@cnps.PHILIPS.nl (Jeroen Kessels) wrote: } defaria@hpclapd.HP.COM (Andy DeFaria) writes: } } > how to you do exponentiation in TP 4.0 (or 5.0 or 5.5). } > ... } > the usually "**" operator only produced a compile error. What gives? } ... stuff deleted... } function Power(x, y : extended) : extended; } { Return x to the power of y. Note: a non-integer power of a negative } number is not defined in mathematics. This routine will therefore } round y to an integer if x is negative. } As an aside, technically speaking, I'm sure you realize that non-integer powers of negative numbers ARE defined in mathematics. They produce imaginary numbers. It would be more accurate to say that it's not defined for the domain of REAL numbers. picky picky picky :-) ------------------------------------------------------------------------ Disclaimer: My opinions do not necessarily reflect those of my employer. ======================================================================== mike@DRD.Com uunet!apctrc!drd!mike ========================================================================