Re:Unix History and the `DC` Calculator
by fsckboy on Monday September 02, 2024 @12:02AM
(#41422467)
is your bc the bc or is it a bc? bc is a POSIX standard so "a" bc would be as good as "the" bc, i'm just curious. "man bc" on Fedora linux says the author is Phil Nelson
Re:Unix History and the `DC` Calculator
by gavinhoward on Monday September 02, 2024 @12:22AM
(#41422552)
Depends on what platform you are using. Most Linux distros? Only a bc. FreeBSD and macOS? The bc. [1]
[1]: https://gavinhoward.com/2023/02/my-code-conquered-another-os...
The author is correct on the parsing of "normal" vs. Reverse Polish notation. My `bc`, with normal expressions, needs 1555 LoC for parsing. My `dc` needs just 298.
I have a couple posts ([1], [2]) about `dc` tricks and code on my blog.
And yes, I have an HP 48G [3]. :)
[1]: https://gavinhoward.com/2019/12/bc/dc-tips-and-tricks/
[2]: https://gavinhoward.com/2021/04/a-dc-script-for-easter/
[3]: https://gavinhoward.com/uploads/easter-dc-script/hp-48g.jpg