Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Time-a-function/Tcl/time-a-function.tcl
Normal file
7
Task/Time-a-function/Tcl/time-a-function.tcl
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
proc sum_n {n} {
|
||||
for {set i 1; set sum 0.0} {$i <= $n} {incr i} {set sum [expr {$sum + $i}]}
|
||||
return [expr {wide($sum)}]
|
||||
}
|
||||
|
||||
puts [time {sum_n 1e6} 100]
|
||||
puts [time {} 100]
|
||||
Loading…
Add table
Add a link
Reference in a new issue