Summary

License

GPL-v2 & MIT

Source

http://github.com/DaveDavenport/ESCalc/

Description

Warning This program is has little real-world application.

A small utility that helps calculating memory spaces. It uses readline to get user input, and muparser to parse the expresssion. The following postfixes are supported:

  • k = 1000

  • M = 1000*1000

  • G = 1000*1000*1000

  • kb = 1024

  • mb = 1024*1024

  • gb = 1024*1024*1024

It supports the following operations:

+, -, *, /, %, >>, <<, &, |, &&, ||, <. >, <=, >=, ==, ^

To reuse result, you can use the variable ans.

Example:

$escalc
> (12+24kb+0x400)&0x00FFFFFFFF
Result:
dec:   25612
hex: 0x640c
bit:   0000 0000 0000 0000 0110 0100 0000 1100
Bytes: 12b, 25kb, 0mb, 0gb

Dependencies

  • C compiler

  • readline

  • mu-parser (copy included)

Limitation

It only works on 32bit unsigned numbers.

License

The program is licensed under the GPL-v2 & MIT license. Mu-parser and mu-parsers code is licensed under the MIT license.

Download

The source code can be found here.