home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG003.ARC
/
JRTPAS-1.LBR
/
JRT29.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
512b
|
22 lines
{Program 4.8
exponentiation with natural exponent}
Program exponentiation;
var e, y : integer;
u, x, z : real;
begin
read( x, y ); write( x, y );
z := 1; u := x; e := y;
while e > 0 do
begin {z * u**e=x**y, e > 0}
while not odd( e ) do
begin
e := e div 2; u := sqr( u );
end;
e := e-1; z := u * z
end;
writeln( z ) {z = x**y}
end.