-
-
Save thinkphp/7d020c2c012328899f554e306f796d7e to your computer and use it in GitHub Desktop.
ln.c
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
double computesLN2(double n, double lo, double hi) { | |
double a = lo, b = hi, m; | |
while( fabs(a - b) > EPS ) { | |
m = (a + b) / 2.0; | |
if( (f( m, n) ) < 0) a = m; | |
else | |
b = m; | |
} | |
return (a+b)/2.0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment