Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Jensens-Device/Simula/jensens-device.simula
Normal file
23
Task/Jensens-Device/Simula/jensens-device.simula
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
comment Jensen's Device;
|
||||
begin
|
||||
integer i;
|
||||
real procedure sum (i, lo, hi, term);
|
||||
name i, term;
|
||||
value lo, hi;
|
||||
integer i, lo, hi;
|
||||
real term;
|
||||
comment term is passed by-name, and so is i;
|
||||
begin
|
||||
integer j;
|
||||
real temp;
|
||||
temp := 0;
|
||||
for j := lo step 1 until hi do
|
||||
begin
|
||||
i := j;
|
||||
temp := temp + term
|
||||
end;
|
||||
sum := temp
|
||||
end;
|
||||
comment note the correspondence between the mathematical notation and the call to sum;
|
||||
outreal (sum (i, 1, 100, 1/i), 7, 14)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue