TUI calculator for programmers working close to the bits
github.com
github.com
It automatically detects how many bits your number must have and uses the minimum, or you can tell it the standard bit sizes or even use a custom bit size. It will handle 2's complement signed integers.
See the manual ([2]), especially the extended math library section ([3]).
It's also a normal `bc`, with every feature of all other implementations.
I should add floating point support, though.
[1]: https://git.yzena.com/gavin/bc
[2]: https://git.yzena.com/gavin/bc/src/branch/master/manuals/bc/...
[3]: https://git.yzena.com/gavin/bc/src/branch/master/manuals/bc/...
There is a simulator (for Windows) available [2]. (No affiliation; but I made a simulator for the cousin calculator HP-15C [3]).
[1]: https://hpmuseum.org/hp16.htm [2]: http://hp16c.org [3]: https://hp15c.com
-> ᛯ ipcalc 1.1.1.1/23
Address: 1.1.1.1 00000001.00000001.0000000 1.00000001
Netmask: 255.255.254.0 = 23 11111111.11111111.1111111 0.00000000
Wildcard: 0.0.1.255 00000000.00000000.0000000 1.11111111
=>
Network: 1.1.0.0/23 00000001.00000001.0000000 0.00000000
HostMin: 1.1.0.1 00000001.00000001.0000000 0.00000001
HostMax: 1.1.1.254 00000001.00000001.0000000 1.11111110
Broadcast: 1.1.1.255 00000001.00000001.0000000 1.11111111
Hosts/Net: 510 > 10+0xff+0b00010 ->hex
10 + 255 + 2 = 0x10B
Also does some fancy unit conversion stuff like "how long it would take to transfer X gigabytes over Y Mbit link > 200GB / (100Mbit/s)
(200 gigabytes) / ((100 megabits) / second) = 4 h + 26 min + 40 sIf you use my `bc` ([1]), configure it with:
./configure.sh -O3 -Sbc.sigint_reset
That build will then exit on Ctrl+c.Normal people would assume that you wanted to copy something into the clipboard.
So there's no really good reason for that behaviour… which is probably why not all bc flavours do it. GNU bc as shipped by Arch e.g. does just silently quit on ^C, and far as I can tell they're not patching it either.
I settled with Qalculate - it can do some things as Spotlight (currency conversion) and also quite nice for programmer-related tasks. Although I miss few features here and there it is quite good.
sadly, no more - too old and forgetful
this would have been about 1984
I mention this because the Readme specifically calls out the various ways of inputting an expression, which is a non-issue with any compiler background. (It's handled by the lexer, which is step that handles processing input into "lexical" elements, which are then passed to actual "parser" that constructs the syntactic structure)
[1] https://rizin.re
It can operate on rpn as well as algebraic.
It is good.
…I think I'll stay old school and continue pressing those satisfying physical keys.
julia> bitstring(Int32(4))
"00000000000000000000000000000100"
julia> bitstring(2.2)
"0100000000000001100110011001100110011001100110011001100110011010"