kota's memex

An arbitrary precision CLI calculator.

Works mostly as you'd expect, but there's a few gotchas.

(4+7)*2

22

scale

The default scale is 0. Division operations always use the scale setting. So if you don’t set scale, you may get unexpected answers:

3/2          # prints 1
scale=3; 3/2 # prints 1.500

non base-10 number systems

Use the ibase and obase commands to set input and output base systems between base-2 and base-16. Remember that once you use ibase, any number you enter is expected to be in the new declared base.

Note: these are all run in separate sessions of bc. If you were to run these sequentially, the first ibase=16 set the base to 16 as you'd expect, but the second one isn't harmless, it sets it to base 22. In fact if you're in base 16 and want to return to base 10 you must type ibase=A.

ibase=16; A42F                # prints 42031
ibase=16; 5F72+C39B           # prints 74509
obase=16; ibase=16; 5F72+C39B # prints 1230D