Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Jensens-Device/Oz/jensens-device-1.oz
Normal file
14
Task/Jensens-Device/Oz/jensens-device-1.oz
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
declare
|
||||
fun {Sum I Lo Hi Term}
|
||||
Temp = {NewCell 0.0}
|
||||
in
|
||||
I := Lo
|
||||
for while:@I =< Hi do
|
||||
Temp := @Temp + {Term}
|
||||
I := @I + 1
|
||||
end
|
||||
@Temp
|
||||
end
|
||||
I = {NewCell unit}
|
||||
in
|
||||
{Show {Sum I 1 100 fun {$} 1.0 / {Int.toFloat @I} end}}
|
||||
6
Task/Jensens-Device/Oz/jensens-device-2.oz
Normal file
6
Task/Jensens-Device/Oz/jensens-device-2.oz
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
declare
|
||||
fun {Sum Lo Hi F}
|
||||
{FoldL {Map {List.number Lo Hi 1} F} Number.'+' 0.0}
|
||||
end
|
||||
in
|
||||
{Show {Sum 1 100 fun {$ I} 1.0/{Int.toFloat I} end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue