This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Next<A, B, C> extends Task<A, C> { | |
private Task<A, B> task; | |
private Task<B, C> nextTask; | |
public Next(Task<A, B> task, Task<B, C> nextTask) { | |
this.task = task; | |
this.nextTask = nextTask; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define tolerance 0.00001) | |
(define (fixed-point f first-guess) | |
(define (close-enough? v1 v2) | |
(< (abs (- v1 v2)) tolerance)) | |
(define (try guess) | |
(let ((next (f guess))) | |
(if (close-enough? guess next) | |
next |
OlderNewer