Site Tools


notes:bc_cheat_sheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:bc_cheat_sheet [2026/06/10 00:32]
103.232.154.80 old revision restored (2007/10/18 11:27)
notes:bc_cheat_sheet [2026/06/13 21:24] (current)
216.73.216.124 old revision restored (2026/06/03 02:16)
Line 7: Line 7:
   *  bc is a [[http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html |POSIX standard]] but the [[http://www.gnu.org/software/bc/ | GNU version]] has added functionality   *  bc is a [[http://www.opengroup.org/onlinepubs/009695399/utilities/bc.html |POSIX standard]] but the [[http://www.gnu.org/software/bc/ | GNU version]] has added functionality
  
-  *  bc by default runs in integer mode (scale=0) and with no trig functions, running ''bc -l'' loads trig functions and sets scale to 20+  *  bc by default runs in integer mode (scale=0) and with no trig functions, running "bc -lloads trig functions and sets scale to 20
  
-  *  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 ''echo 3+4 | bc'' .+  *  bc can only take expressions on standard input (or in files), not directly on the command line e.g. echo 3+4 | bc
  
   * [[http://www.phodd.net/cyrek/gnu-bc/ | This]] is a great collection of bc functions. funcs.bc and logic.bc  are the basic ones. [[ http://x-bc.sourceforge.net/extensions_bc.html | This]] is a collection of more sanely named basic scientific calculator functions.   * [[http://www.phodd.net/cyrek/gnu-bc/ | This]] is a great collection of bc functions. funcs.bc and logic.bc  are the basic ones. [[ http://x-bc.sourceforge.net/extensions_bc.html | This]] is a collection of more sanely named basic scientific calculator functions.
Line 23: Line 23:
 </code> </code>
    
-So now '' mbc '(3+5)/6' '' works as expected+So now "mbc '(3+5)/6'works as expected
  
   * 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.
notes/bc_cheat_sheet.1781076754.txt.gz · Last modified: 2026/06/10 00:32 by 103.232.154.80