I had been using GUI based calculators SpeedCrunch and Galculator for long. Recently I got addicted to the drop-down terminal AltYo and tend to do everything from the terminal. I found the feature-rich wcalc, which can literally do anything you might expect from a scientific calculator. One of its powerful features is the support for variables which allows you to use it like a programming language. wcalc is a very old utility. The development started in early 2002.

Features

Use natural expressions, no learning curve

Use decimal, hex, oct, binary, degree or radian

Unit conversions

Set to throw warning if result is rounded off

Variables for storing numerical values, pre-defined functions or literals (with descriptions)

Last result stored in variable a

Stores history through multiple invocations

Use functions like floor, sin, sqrt, fact, rand, round, abs, ceil, log and so on…

Constants for Pi, logarithmic constant, acceleration due to gravity, speed of light etc. It supports Universal, Electromagnetic, Atomic and Nuclear, Physio-Chemical and Random constants.

Several commands to control the behaviour and interpretation

Store settings in ~/.wcalcrc

Store persistent information between instances in ~/.wcalc_preload

Installation

To install wcalc on Ubuntu, run:

$ sudo apt-get install wcalc

Usage

Calculate expression as argument $ wcalc '(13+14)/(3-5)' = -13.5

Calculate (15+19)/(3+4) interactively $ wcalc Enter an expression to evaluate, q to quit, or ? for help: -> 15+19 = 34 -> a/(3+4) = 4.85714 -> quit Note that the special variable a always stores the last result.

Using variables, functions and constants $ wcalc Enter an expression to evaluate, q to quit, or ? for help: -> foo=5 foo = 5 -> bar=foo+4 bar = 9 -> baz=(sin(bar)+foo)/pi baz = 1.64134 -> quit

Single-line base conversion from decimal to hex $ echo 100 | wcalc -h = 0x64

Interactive base conversion $ wcalc Enter an expression to evaluate, q to quit, or ? for help: -> 10*34 = 340 -> \h Hexadecimal Formatted Output = 0x154 -> \b Binary Formatted Output = 0b101010100

Webpage: wcalc

Similar software