Re: Guide / Tools
Jochen Spieker:
> Morel Bérenger:
> > $man dc
> > => "reverse-polish" ? What is it? It is surely not for simple
> > calculations and conversions...
>
> That's probably only for majors in maths or computer science.
No, dc is a perfect tool for simple calculations and conversions.
Instead of entering e.g. 2+3= you use the so-called reverse-polish
notation: 2 3+
Once used to it, you'll probably never want anything else.
Imagine a stack:
0
0
0
0
After entering 2, it looks like this:
0
0
0
2
After entering 3:
0
0
2
3
After entering +:
0
0
0
5
In dc:
$ dc
2 3+p
5
As a final example, the calculation of (1 + V5)/2
(V means square root here) up to 6 decimal places:
$ dc
6k1 5v+2/p
1.618033
Reply to: