LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   math functions like sqrt? (https://www.linuxquestions.org/questions/linux-software-2/math-functions-like-sqrt-832107/)

davidstvz 09-14-2010 11:13 AM

math functions like sqrt?
 
I have a user that wants to use basic math functions from the command line like sqrt and such. Apparently it was installed on the previous server we were using, but not on this new Debian server by default.

Anyone know what package has that functionality?

GrapefruiTgirl 09-14-2010 11:15 AM

Maybe `bc`, the "basic calculator" ? There are other similar ones but this is the first one that comes to mind for me.

davidstvz 09-14-2010 11:27 AM

that's something, but doesn't let you call c style math functions from the commandline

the previous OS was Suse Linux 10

GrapefruiTgirl 09-14-2010 11:31 AM

Sounds like maybe you're looking for `calc`, according to these:
http://rpmfind.net/linux/RPM/Suse_Linux_10.html
http://www.isthe.com/chongo/tech/comp/calc/
and based on a quick Google.

alan99 09-14-2010 10:11 PM

Just about every linux distro probably has perl installed.

Just type this at the command line
Quote:

perl <&1
This let you enter a "quick and dirty" perl program to stdin
Quote:

print (sqrt(25),"\n");
(hit enter at the end of the line and then Ctl-D on the next empty line.
It should return 5 (the square root of 25)

davidstvz 09-15-2010 11:13 AM

OK


I misunderstood what the user wanted. The user wants to type:

man sqrt

...and get a man page for the C function sqrt. Apparently this works on Cygwin and it worked on the old Suse Linux 10 box.

Anyone know what I can install to access info about C functions as man pages?

johnsfine 09-15-2010 11:32 AM

So you are asking what package contains the file that has sqrt.3 as part of its filename.

If you have apt-file search installed and set up, you could use that for such questions.

If you want to do such searches online, the Ubuntu answer is easy to get from
http://packages.ubuntu.com/
and the Ubuntu answer regarding most package names is the same as the package name in other Debian based distributions.

For sqrt.3, the Ubuntu answer is at
http://packages.ubuntu.com/search?se...lucid&arch=any

In that answer, if you ignore the language and otherwise over specialized choices, you can spot the general choice, which is the package manpages-dev

I assume you know how to install that package.

alan99 09-15-2010 02:38 PM

If you want a gui interface for man pages, there is x man or if there is a web server on that machine, there is Dwww for debian which allows you to search man pages from a web interface.


All times are GMT -5. The time now is 03:11 PM.