TIP: Click on subject to list as thread! ANSI
echo: delphi
to: RYAN POTTS
from: CHRIS MANN
date: 1996-05-15 10:44:00
subject: Powers and Logs

On May 15 09:52 96, Ryan Potts of 1:157/110 wrote:
JM>> (pssst! Anyone listening at Borland?)
 DB>> If I remember correctly the '**' operator raises the number
 DB>> to the power of the second number, 2 to the 3rd power =
 DB>> '2**3' and 10 to the 5th power equals '10**5', am I right? 
 RP> Also pascal doesn't have a Log base 10 function either.  Here are a 
 RP> couple simple functions that I have written.
 RP> function log(number : real):real;
 RP> begin
 RP> log:=ln(number) / ln(10);
 RP> end;
 RP> function power( Man : Real; Pwr : Real ) : Real;
 RP> begin
 RP> Power := Exp( Ln( Man ) * Pwr );
 RP> end;
This has changed... Check the Math Unit (Delphi 2.0).
Unit
Math
Declaration
function Log10(X: Extended): Extended;
Description
The Log10 function returns the log base 10 of X.
---
function Log2(X: Extended): Extended;
Description
The Log2 function returns the log base 2 of X.
Declaration
function Power(Base, Exponent: Extended): Extended;
Description
The Power function raises Base to any power. For example, BaseExponent. For 
fractional exponents or exponents greater than MaxInt, Base must be greater 
than 0. 
Chris
--- Msgedsq 2.2e
---------------
* Origin: Esc1.71 - When you're old enough to drive the bus. (1:157/534.30)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.