Tuesday, January 09, 2007

Introducing rpnbuddy

rpnbuddy is an AIM bot that implements a reverse polish notation calculator with floating point, fixed decimal places, decimal, binary, hexadecimal and octal modes. It's currently in somewhat beta, but feel free to chat to it using the AIM user name 'rpnbuddy'.

Theoretically, rpnbuddy is online all the time, but if you have trouble accessing it please drop me a line. As usual, rpnbuddy is a totally free service from me; I'll do my best to fix bugs and add features as requested. At this time the source code is not open.

Typing help makes rpnbuddy print out the following help information:

Arithmetic operators: + - * / % (mod)
Bitwise operators: and, xor, not, or
Functions: sqrt, e^x, 10^x, x^y, cos, sin, tan, ln, log, int, abs, x^2, 1/x
Set word size: push word size (8, 16, 32, 64) then wsize
Set base: dec, bin, oct, hex
Set floating point mode: float
Set fixed decimal places: push decimal places (up to 16) then fix
Show stack: stack
Show state: state
Useful constants: pi, e

And here's a the log of an rpnbuddy session calculating the area of a circle of radius 10:

(13:27:31) jgc: pi
(13:27:31) rpnbuddy: 3.14159265358979
(13:27:39) jgc: 10
(13:27:41) jgc: x^2
(13:27:42) rpnbuddy: 100
(13:27:43) jgc: *
(13:27:43) rpnbuddy: 314.159265358979

Or switching to hexadecimal mode you can do a little bitmasking:

(13:28:28) jgc: 0
(13:28:29) jgc: hex
(13:28:30) rpnbuddy: Unsigned; Base: hex; Word size: 32
(13:28:30) rpnbuddy: 00000000
(13:28:38) jgc: 1234abcd
(13:28:42) jgc: fefefefe
(13:28:43) jgc: and
(13:28:43) rpnbuddy: 1234aacc
(13:28:52) jgc: ff
(13:28:53) jgc: xor
(13:28:53) rpnbuddy: 1234aa33

Enjoy!

Labels:

If you enjoyed this blog post, you might enjoy my travel book for people interested in science and technology: The Geek Atlas. Signed copies of The Geek Atlas are available.

<$BlogCommentBody$>

<$BlogCommentDateTime$> <$BlogCommentDeleteIcon$>

Post a Comment

Links to this post:

<$BlogBacklinkControl$> <$BlogBacklinkTitle$> <$BlogBacklinkDeleteIcon$>
<$BlogBacklinkSnippet$>
Create a Link

<< Home