*To*: debian-user <debian-user@lists.debian.org>*Subject*: shell wrappers for trig and other mathematical functions*From*: Dan Hitt <dan.hitt@gmail.com>*Date*: Tue, 1 Oct 2019 20:32:01 -0700*Message-id*: <[🔎] CAOphizJnMAXDnLRaMNRUGpC2A7W6S03nJGXb2Pgk53wF71WRzw@mail.gmail.com>

I'm half-way looking for some shell wrappers for common trig functions like sin, cos, exp, log, and others.

I'm aware of bc, but it seems cumbersome.

I would like to just type 'sin 1' and get the sine (of 1 radian), or type 'log 2' and get the natural or maybe common log of 2. (Probably any such program should do something intelligent when faced with multiple or zero arguments, such as computing the sine or log of each, so that they could be chained together. And maybe such a program would pay attention to environment variables or optional command line arguments to tune its behavior.)

These kinds of programs would be super-easy to write in just about any language (i guess perhaps even just as bash functions which shell out to bc for at least some of the simpler functions) but before i actually do something like that, i wonder if somebody has already done it, whether there exist any standards or good ideas, etc. (Because if somebody has a good, thoughtful exp program, for example, then it could be cookie-cutter copied to a bunch of other functions.)

There is a precedent of sorts in Paul Rubin's factor program, which is just oh-so-handy when you're wondering how an integer factors, but don't want to start up some heavy-weight system just to find out.

Thanks in advance for any pointers or advice! :)

dan

**Follow-Ups**:**Re: shell wrappers for trig and other mathematical functions***From:*David Christensen <dpchrist@holgerdanske.com>

**Re: shell wrappers for trig and other mathematical functions***From:*<tomas@tuxteam.de>

**Re: shell wrappers for trig and other mathematical functions***From:*Klaus Singvogel <deb-user-ml@singvogel.net>

- Prev by Date:
**Re: USB flash drive opens read only -- how to fix?** - Next by Date:
**Re: shell wrappers for trig and other mathematical functions** - Previous by thread:
**Re: virtualbox 5.1 guest utils problem** - Next by thread:
**Re: shell wrappers for trig and other mathematical functions** - Index(es):