home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug050.ark
/
POWTWO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1984-04-29
|
387b
|
20 lines
(* decimal representaton of negative powers of 2 *)
const n=10;
type digit = 0..9;
digtyp = array[1..n] of digit;
var i,k,r: integer;
d : digtyp;
begin for k:=1 to n do
begin put#0('.'); r:=0;
for i:=1 to k-1 do
begin r:=10*r+d[i]; d[i]:=r/2;
r:=r-2*d[i]; put#0(d[i]+'0')
end;
d[k]:=5; put#0('5',13,10)
end
end.