Roots of a function: Difference between revisions
Content added Content deleted
(add Ruby) |
|||
Line 346: | Line 346: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
{{incorrect|Java|This does not detect crossings from one sign to the other. It will only see a root if we sample a value that happens to be close enough to 0, which is unlikely since epsilon is so small.}} |
|||
<lang java>public class Roots{ |
<lang java>public class Roots{ |
||
private static final double epsilon= 1E-10; //error bound, change for more or less accuracy |
private static final double epsilon= 1E-10; //error bound, change for more or less accuracy |