HC(1)

NAME
hc - multi-radix integer desk calculator

SYNOPSIS
hc []

DESCRIPTION
hc (the hacker's calculator) is a simple yacc-based integer arithmetic calculator designed for doing quick-and-dirty bitwise calculations. It supports most common integer arithmetic operations, and operates in hex, octal, or decimal modes. hc is fairly simple: enter integer arithmetic expressions, and it will report the result. Operator precedence is similar (but not identical to) C; the operators as well are largely the same as well. It does not support shift operations due to limitations in the lexical analyzer, and it does not support comparisons. A future release based on lex(1) might change this.

COMMANDS
d Outputs all results in decimal. h Outputs all results in hexadecimal. o Outputs all results in octal. a Prints an about box. ? Prints a brief help message describing the commands. q Quits hc gracefully (as opposed to via syntax error). v Prints the current version. Arithmetic expressions may be typed as with any other calculator program, using standard notation. The operator precedence is ~ -(unary minus) < > (shift left/right) * / % + - & | ^ Operators are as in C unless otherwise indicated. Octal input is preceded with a zero (0) as in C; hex input is preceded with 0x.

COMMENTS
Obviously someone likes this program; thanks to Scott Saulters <fraybentos@beer.com> (shift instructions) and Eduardo Ferra (new lexer and binary input; not yet incorporated) for their contributions.

KNOWN ISSUES
None at this time. Binary input has been implemented but not added.

SEE ALSO
bc(1); Kernighan & Pike