| Rev | Author | # | Line |
|---|---|---|---|
| 2 | AlastairPorter | 1 | Notes for the [bc(1)] arbitrary precision calculator |
| 2 | ---- | ||
| 3 | |||
| 1 | BenStaz | 4 | !!Handy Variables |
| 5 | |||
| 4 | BenStaz | 6 | !scale |
| 7 | |||
| 8 | Defines how some operations use digits after the decimal point . (Default 0) | ||
| 1 | BenStaz | 9 | So if you type ''5/5'' ''bc'' interprets this as 5.00000/5.00000. and the answer is 1.00000 |
| 10 | |||
| 4 | BenStaz | 11 | !last |
| 12 | |||
| 13 | A variable that has the value of the last printed number. | ||
| 1 | BenStaz | 14 | So if you have a running total in ''bc'' of 100, then last+10 would result in 110. |
| 4 | BenStaz | 15 | |
| 16 | !ibase | ||
| 17 | |||
| 18 | Define the conversion base for input numbers. | ||
| 19 | |||
| 20 | !obase | ||
| 21 | |||
| 22 | Define the conversion base for output numbers. | ||
| 23 | |||
| 6 | BenStaz | 24 | ---- |
| 25 | |||
| 26 | !!Common Operations | ||
| 27 | |||
| 28 | !Input numbers with a particular base but output them in a different base. | ||
| 29 | |||
| 30 | Say we want to add the binary numbers 101 and 111 but output the result in decimal. | ||
| 4 | BenStaz | 31 | |
| 32 | <verbatim> | ||
| 33 | obase=10 | ||
| 34 | ibase=2 | ||
| 35 | 101+111 | ||
| 36 | 12 | ||
| 37 | </verbatim> | ||
| 38 | |||
| 39 | Note : Keep in mind if you set the ibase to a particular number, all variable values you set will need to be in that base. | ||
| 40 | |||
| 41 | For example : Say we have ibase=2 and obase=10. To change ibase to 10 (decimal) then we would do : ''ibase=1010'' | ||
| 42 | |||
| 2 | AlastairPorter | 43 | ---- |
| 44 | CategoryNotes |
lib/blame.php:177: Warning: Invalid argument supplied for foreach()