Post Reply 
bc (basic calculator) and libraries of functions
07-21-2018, 08:40 PM (This post was last modified: 07-21-2018 08:43 PM by pier4r.)
Post: #10
RE: bc (basic calculator) and libraries of functions
I was contemplating one aspect that stops me to use this or that well-known programming language. The fact that my homelab has all the different types of OSes and therefore it is a bit difficult to have the programming language of choice on the minimum needed versions over all systems.

The languages that is the most stable of all, being still relatively simple to use, is gawk. Its lack of math (many) functions, though, pushed me to think multiple times to combine it with bc (in the two way IO process, that is pretty handy https://www.gnu.org/software/gawk/manual...002fO.html ). Bc does the function computation, the rest is done by awk. Is not optimal, but is handy.

Well today I noticed that since 4.1 awk just extended "for fun" the math abilities to arbitrary precision. https://www.gnu.org/software/gawk/manual...Arithmetic

I am pretty sure that someone shared already an extended math library on the now defuct awk.info site (n1), anyway porting the functions made for bc to gawk itself may make them even more handy for quick prototyping/scripting. It could be handy even for others.

n1: "the internet does not forget", well no. It forgets a lot. Another nice site to disappear in some days is: https://chessprogramming.wikispaces.com/ , although they are trying to move it to their own domain. The point being, without maintainer, things are lost.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: bc (basic calculator) and libraries of functions - pier4r - 07-21-2018 08:40 PM



User(s) browsing this thread: 1 Guest(s)