본문 바로가기

Secant Method c언어로 구현하기 #include #include #define PI 3.1415926535897931#define e 2.71828 #define thshold 2 * pow(10,-4) double fx(double x){ return (7*sin(x) * pow(e,(-x)) -1);} void Secant_Method(double xl, double xu){ double a,b,fa,fb,p; double sol; int i=0; double eia=100; double eit; a = xl; b = xu; fa=fx(a); fb=fx(b); while(1) { p=b-fb*(b-a)/(fb-fa); eia = fabs((b-a)/b)*100; if(eia 더보기
False Position Method c언어로 구현하기 #include #include #define thshold 2 * pow(10,-4) double sinfx(double x){ return (x*x - sin(x));} void false_position(double xl, double xu){ int i; double q0, q1, q,p; double num = 40; double xr2; q0 = sinfx(xl); q1 = sinfx(xu); i = 1; p = xu - q1 * (xu - xl) / (q1 - q0); q = sinfx(p); double e0=100.0; printf("%d\t%lf\t%lf\t%lf\t%lf\n", i, xl,xu,p, e0); while(1) { p = xu - q1 * (xu - xl) / (q1 - .. 더보기
파이썬 웹표준 라이브러리 소개 및 변경사항 /* written by kaspy (kaspyx@gmail.com)*/ 파이썬은 버전에 따라 크게 2.x와 3.x로 나뉜다. 함수와 클래스등은 거의 동일하지만, 패키지명과 모듈명이 재구성 되었다고한다. 또한 웹 어플리케이션에 사용되는 라이브러리는 웹 클라이언트용 API와 웹서버 API로 나뉜다. * 파이썬 3.x 와 2.x 표준 라이버리 모듈 구성 변경사항(빨강색 음영은 클라이언트단, 파랑색 음영은 서버단임은 참고) 파이썬 3.x 모듈명 파이썬 2.x 모듈명 파이썬 3.x 에서의 변화 urllib.parse urlparse urllib 일부 하나의 urllib 패키지로 모아 모듈을 기능별로 나눔 urllib.request urllib2 대부분 urllib 일부 urllib.error urllib2 대부.. 더보기