GNU bc

mr wong   google bookmarks   del.icio.us   yigg   digg   folkd
bc is a programming language with a syntax that is similar to C and which supports the calculation with a defined accuracy. This Demo enables the interactive use of this command line tool. A description of the syntax can be found under the following link.

Examples

define fact (x) {
if(x < 1) return 1
return (x*fact(x-1))
}

fact(9)

362880
    
pi=3.1415926535897932384626433832795
# sin
s(pi)
0
# cos
c(pi)
-1.00000000000000000000
    
1+1
2
1 / 3
.33333333333333333333
4 * (6 + 7)
52
    
Please wait!
initializing bc...
1024 characters possible