This is a calculator based on stack concept ( Last in
First out , LIFO ) i.e pushing and popping.also it
employs a parenthesis free logic invented by a polish
mathematician before second world war.
Here are some examples ...
echo '65p'| dc --> pushes the value 65 to a stack and
then as it encounters 'p' it pops out the value as an
echo '65P'| dc --> pushes 65 and pops out as a
as the character corresponding to 65 is A it is
echo '+' | dc ---> says stack is empty. coz when it
encounters + it pops out last two values from stack,
calculates the sum and it pushes the result to stack.
same applies for *,/ etc.
echo '5 5+p' | dc ---> prints 10.
echo '65P80P82P73P76P32P70P79P79P76P10P' | dc
is enough for printing APRIL FOOL. the other things
are redundant just for confusing.
Looks Pretty good :-)
echo '82 43/25 65P80P82P73P76P32P70P79P79P76P10P'|
--- Ram Prakash <RamP@xxxxxxxxxx> wrote:dc
I have already tried it out.
That's why I want to know what happens.
I want to know what the command does.
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx
"unsubscribe <password> address"
in the subject or body of the message.