Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
include c:\cxpl\codes; \intrinsic 'code' declarations
|
||||
|
||||
func real Power(X, Y); \X raised to the Y power; (X > 0.0)
|
||||
real X; int Y;
|
||||
return Exp(float(Y) * Ln(X));
|
||||
|
||||
func IPower(X, Y); \X raised to the Y power
|
||||
int X, Y;
|
||||
int P;
|
||||
[P:= 1;
|
||||
while Y do
|
||||
[if Y&1 then P:= P*X;
|
||||
X:= X*X;
|
||||
Y:= Y>>1;
|
||||
];
|
||||
return P;
|
||||
];
|
||||
|
||||
int X, Y;
|
||||
[Format(9, 0);
|
||||
for X:= 1 to 10 do
|
||||
[for Y:= 0 to 7 do
|
||||
RlOut(0, Power(float(X), Y));
|
||||
CrLf(0);
|
||||
];
|
||||
CrLf(0);
|
||||
for X:= 1 to 10 do
|
||||
[for Y:= 0 to 7 do
|
||||
[ChOut(0, 9); IntOut(0, IPower(X, Y))];
|
||||
CrLf(0);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue