This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
notes:bc_cheat_sheet [2026/05/31 01:52] 114.119.158.251 old revision restored (2007/10/18 11:24) |
notes:bc_cheat_sheet [2026/06/07 04:46] (current) 43.153.220.175 old revision restored (2026/06/03 02:16) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== GNU bc Cheat Sheet ==== | + | ===== GNU bc Cheat Sheet ===== |
| - | === Overview === | + | ==== Overview |
| * [[http:// | * [[http:// | ||
| Line 7: | Line 7: | ||
| * bc is a [[http:// | * bc is a [[http:// | ||
| - | * bc by default runs in integer mode (scale=0) and with no trig functions, running | + | * bc by default runs in integer mode (scale=0) and with no trig functions, running |
| - | * bc can only take expressions on standard input (or in files), not directly on the command line e.g. echo 3+4 | bc | + | * bc can only take expressions on standard input or in files, not directly on the command line. One way to do a bc one-liner is '' |
| * [[http:// | * [[http:// | ||
| Line 23: | Line 23: | ||
| </ | </ | ||
| - | So now "mbc ' | + | So now '' |
| * bc uses readline so ⇑ and ⇓ (for history) and ctrl-r (for searching) work as expected. | * bc uses readline so ⇑ and ⇓ (for history) and ctrl-r (for searching) work as expected. | ||
| - | === Basic Usage === | + | ==== Basic Usage ==== |
| * Any alphanumeric variable name is allowed once it starts with a letter. | * Any alphanumeric variable name is allowed once it starts with a letter. | ||
| Line 51: | Line 51: | ||
| * && , || , ! work as expected (return 0 or 1). | * && , || , ! work as expected (return 0 or 1). | ||
| - | === Advanced Usage === | + | ==== Advanced Usage ==== |
| * New functions are easy to define e.g. < | * New functions are easy to define e.g. < | ||