Skip to content

Commit

Permalink
Not Haskell!
Browse files Browse the repository at this point in the history
  • Loading branch information
knaveofdiamonds committed Mar 4, 2012
1 parent f4ca80a commit 8ff5131
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 1.3.scm
Expand Up @@ -11,8 +11,8 @@
(define h (/ (- b a) n))
(define (yk k) (f (+ a (* k h))))
(* (/ h 3) (+ (yk 0)
(* 4 (sum yk 1 (\lambda (i) (+ i 2)) (- n 1)))
(* 2 (sum yk 2 (\lambda (i) (+ i 2)) (- n 1)))
(* 4 (sum yk 1 (lambda (i) (+ i 2)) (- n 1)))
(* 2 (sum yk 2 (lambda (i) (+ i 2)) (- n 1)))
(yk n))))

; Gives 1/4 for both n = 100 and n = 1000
Expand Down

0 comments on commit 8ff5131

Please sign in to comment.