--- rpn/README.orig 2005-09-28 22:21:03.000000000 -0400 +++ rpn/README 2005-09-28 22:22:31.000000000 -0400 @@ -10,6 +10,7 @@ - Subtraction * Multiplication / Division +% Modulus (fmod(3)) c Change the sign of the top element . Print the top element --- rpn/Makefile.orig 2005-09-28 22:22:45.000000000 -0400 +++ rpn/Makefile 2005-09-28 22:23:06.000000000 -0400 @@ -3,4 +3,4 @@ # Licensed under the Open Software License version 2.1 rpn: rpn.o stack.o lexer.o - $(CC) $(CFLAGS) $^ -o $@ + $(CC) $(CFLAGS) $^ -lm -o $@ --- rpn/rpn.c.orig 2005-09-28 22:20:58.000000000 -0400 +++ rpn/rpn.c 2005-09-28 22:22:08.000000000 -0400 @@ -6,6 +6,7 @@ */ #include +#include double val; @@ -39,6 +40,10 @@ x = pop(); push(x / pop()); break; + case '%': + x = pop(); + push(fmod(x, pop())); + break; case 'c': push(-pop()); break;