A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/alt-romes/programmer-calculator below:

alt-romes/programmer-calculator: Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits

The programmer calculator is a simple terminal tool designed to give maximum efficiency and flexibility to the programmer working with:

and who likes:

The above picture depicts pcalc without colors, and below is an example of pcalc with colors enabled (--colors) (which change depending on the terminal profile colors)

The idea was born while developing a Nintendo Gameboy Emulator. Romes - the pitcher - found that the tools given online were clunky and did not allow for "nice multitasking"

With the constant need to visualize and manipulate bits, it became evident that a better solution had to come to life

Install from the homebrew official packages

Install from AUR

yay -S programmer-calculator
Building from Source (alternative)

To build from source you need gcc, ncurses, and the source files. If you don't have ncurses, please install it (i.e. with your system's package manager) first. (To install ncurses in Debian based distros run sudo apt-get install libncurses5-dev libncursesw5-dev)

First, clone the repository and change directory to it

git clone https://github.com/alt-romes/programmer-calculator ; cd programmer-calculator

Then, compile the code into an executable file and install it (installs in /usr/local/bin)

Conversely, if you ever want to uninstall, you can run:

Either re-build from source, or, using brew do

followed by

Just run the programmer calculator program

There are various ways to insert values/operators, see the example 2 + 2 below:

Operator precedence and parenthesis for grouping is used.

2+2*3 evaluates to 8 and (2+2)*3 evaluates to 12

All three number representations are available at the same time, you can insert 0xff + 0b101101 - 5 directly onto the calculator

By default, 64 bits are used for arithmetic, however, when working with bits, quite often we want to work with less. With this calculator you can change the amount of bits used. the number displayed will be unsigned

To use 16 bits instead, type 16bit (bits will also work)

To use 8 bits, type 8bit

To use 0 < n <= 64 bits, type nbit

While running the calculator, you can type what you see for it to appear/disappear:

history to toggle the history decimal to toggle the decimal representation binary to toggle the binary representation hex to toggle the hexadecimal representation operation to toggle the operation display

Additionally, the interface colors can be toggled on and off.

To set a default interface, define an alias for the program with the desired hidden options

alias pcalc='pcalc -ibxdosn'

i: history, b: binary, x: hex, d: decimal, o: operation, s: symbols, n: no colors

You can also use the long options to hide parts: --history, --decimal, etc.

ADD  +    SUB  -    MUL  *    DIV  /
MOD  %    AND  &    OR   |    NOR  $
XOR  ^    NOT  ~    SL   <    SR   >
RL   :    RR   ;    2's  _    SE   @

Please reference Contributing

example usage in iterm panel


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4