bc (프로그래밍 언어)
개발자 | 로버트 모리스와 로린다 체리 (벨 연구소) |
---|---|
발표일 | 1975, 47–48년 전 |
운영 체제 | 유닉스, 유닉스 계열, 플랜 9, FreeDOS |
플랫폼 | 크로스 플랫폼 |
종류 | 명령어 |
bc는 basic calculator 또는 bench calculator의 준말로, C 프로그래밍 언어와 문법이 비슷한 전체적 정밀도 계산기 언어이다. bc는 일반적으로 수학적 스크립팅 언어 또는 상호작용적 수학 셸로 사용된다.
예시 코드[편집]
POSIX bc의 "power" 함수[편집]
/* A function to return the integer part of x */
define i(x) {
auto s
s = scale
scale = 0
x /= 1 /* round x down */
scale = s
return (x)
}
/* Use the fact that x^y == e^(y*log(x)) */
define p(x,y) {
if (y == i(y)) {
return (x ^ y)
}
return ( e( y * l(x) ) )
}
외부 링크[편집]
- Dittmer, I. 1993. Error in Unix commands dc and bc for multiple-precision-arithmetic. SIGNUM Newsl. 28, 2 (Apr. 1993), 8–11.
- Collection of useful GNU bc functions
- GNU bc (and an alpha version) from the Free Software Foundation