Skip to content
Sign upLog in
← Back to Community

A reverse polish caculator, in D!

Profile icon
CodeLongAndPros

Today I finished my reverse polish calculator.

It works by pushing elements on the stack.

2 + 3 = 2 3 +

The operations are:

  • +
  • /
  • %
  • ^
  • v (sqrt)
  • V (nth root)

You can also use:
P to print the top element
p to print the top element and pop it
f to print all the stack.

Note that the stack size is 255. You can have 256 values on the stack at once.

So long!

Voters
Profile icon
DynamicSquid
Profile icon
CodeLongAndPros
Comments
hotnewtop
Profile icon
DynamicSquid

Screenshot (101)

Something isn't right here...

Profile icon
CodeLongAndPros

@DynamicSquid
How...

Profile icon
DynamicSquid

@CodeLongAndPros
using deceptive movie magic

Profile icon
CodeLongAndPros

@DynamicSquid
It won't work.

Profile icon
DynamicSquid

@CodeLongAndPros

Oh really? here, try this:

std::cout << "> P\nsquid\n> "; std::cin.get();

:)

Profile icon
CodeLongAndPros

@DynamicSquid
ERR: DOES NOT COMPUTE.