Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
fp:lab03 [2022/03/17 09:02] pdmatei |
fp:lab03 [2022/03/18 15:31] (current) pdmatei |
||
|---|---|---|---|
| Line 45: | Line 45: | ||
| * otherwise, we compute the mid of the range, we recursively compute the integral from a to mid and from mid to b, and add-up the result. | * otherwise, we compute the mid of the range, we recursively compute the integral from a to mid and from mid to b, and add-up the result. | ||
| - | Implement the function ''integral'' which computes the integral of a function f given a range: | + | Implement the function ''integrate'' which computes the integral of a function f given a range: |
| <code scala> | <code scala> | ||
| def integrate(f: Double => Double)(start: Double, stop: Double): Double = ??? | def integrate(f: Double => Double)(start: Double, stop: Double): Double = ??? | ||
| </code> | </code> | ||