What calculator app do you use?

Hi,

This might seem like a strange question, but I was wondering what calculator app people are using? I normally use gCalcTool, but getting annoyed at all the needless dependencies it requires. Looking for something liter that's as functional!

GUI preferred, but an easy to remember CLI app will make me happy too. :)

(python, perl, and PHP are not what I consider to be easy to remember calculator apps)
 
x11/xcalc

Alll it needs is
Code:
/usr/ports/devel/pkg-config
/usr/ports/x11-toolkits/libXaw
/usr/ports/x11-toolkits/libXtp
 
Thank you all for your input. After looking at all of them, galculator was exactly what I was after. :)
 
xcalc but usually Python as I almost always have a python interpreter running. With readline support turned on, a simple press of the tab key will expand what you are working on.

What could be simpler than:

Code:
[font="Courier New"]$ python
Python 2.6.2 (r262:71600, Jun 30 2009, 09:33:04) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> 2 + 3
5
>>> 33/2
16
>>> # note with and without parenthesis
>>> (2+3)/2
2
>>> 2+3/2
3
>>> # need more? Import math
>>> import math
>>> # showing readline provided tab expansion:
>>> math.
             acos         atan2        cosh         factorial    hypot        log10        radians      tanh         
__doc__      acosh        atanh        degrees      floor        isinf        log1p        sin          trunc        
__file__     asin         ceil         e            fmod         isnan        modf         sinh         
__name__     asinh        copysign     exp          frexp        ldexp        pi           sqrt         
__package__  atan         cos          fabs         fsum         log          pow          tan[/font]

Need even more? There are some heavy duty scientific computing libraries for Python. Can't remember how to use a function?

Code:
[font="Courier New"]>>> help(math.factorial)
Help on built-in function factorial in module math:

factorial(...)
    factorial(x) -> Integral
>>> math.factorial(14)
87178291200L[/font]

The interactive shell is a very useful tool.
 
Any sh "Bourne style shell" will do some math.

Some allow $[1+1] while others make it mandatory to use $((1+2)) preferably.

dc is also fairly complicated and nice. echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc

Just joking.
 
Code:
>>> 33/2
16
>>> (2+3)/2
2
>>> 2+3/2
3

Sure, nothing could be simpler, but I think people expect more accuracy from a calculator ;)
 
If there are any other SciTE (programming editor) users, you can get a calculator running fairly quickly just by adding a Lua script. The Lua code for a nice text drawn calculator is available here along with other calculator examples:
http://lua-users.org/wiki/SciteScripts
See the SciteCalculator link. It's not the same a separate calculator program, but nice for a quick calculation like when I want to convert between hex and decimal.
 
DutchDaemon said:
Sure, nothing could be simpler, but I think people expect more accuracy from a calculator ;)

:\

LOL. Clearly I did not even look at the result - this is a left over of Python pre 3.x. In 2.x and earlier, Python's division operator behaves like the C division operator when presented 2 integer arguments.

I've been transitioning away from Python 2.x to Python 3 and in Python 3 real division instead of "floor" division is the default in Python 3.

Code:
Python 3.1
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> 33/2
16.5
>>> (2+3)/2
2.5
>>> 2+3/2
3.5

My system python is 2.6 however and I'd not noticed that I was in a 2.x interpreter. 2.x can do real division instead of floor operations but requires an import to get the "new" behaviour:

Code:
Python 2.6.2 (r262:71600, Jun 30 2009, 09:33:04) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> 33/2
16
>>> (2+3)/2
2
>>> 2+3/2
3
[B]>>> from __future__ import division[/B]
>>> 33/2
16.5
>>> (2+3)/2
2.5
>>> 2+3/2
3.5
>>>

Still simple, but simpler in Python 3.
 
You can get away w/o the future import by typing one of the operands as a float:

Code:
Python 2.6.2 (r262:71600, Jul 18 2009, 00:10:51) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
Type "help", "copyright", "credits" or "license" for more information.
>>> 33/2.0
16.5
 
To be a bit of a contrarian (who, me??), most often I still use a real calculator when I need one (I've an HP 32S II). If the calculation is more than I can easily do on that, I use a spreadsheet. More complicated yet? Write a program.

I do use the Gnome calculator and galculator once in a blue moon, but I prefer the real buttons of a real calculator.
 
I still prefer scilab....
It allows to do vector math very easy....

Also I forgot to mention, that I use mathomatic.... It's not calculator, but it helps with formulas a lot
 
dc(1)

Comes with base, and has postfix notation.

On Windows, I use python.

I actually prefer ``real'' calculators but most sucks because they don't execute commands in the right order (i.e. 5+5*5=50, not 30) so I never use them. Getting a postfix calculator is on the TODO list ...

DutchDaemon said:
Code:
>>> 33/2
16
>>> (2+3)/2
2
>>> 2+3/2
3

Sure, nothing could be simpler, but I think people expect more accuracy from a calculator ;)

That's because you gave python integers, so it will return integers.
Force floats by using n.0 for one of the numbers, for example:

Code:
>>> 33.0 / 2
16.5
>>> (2 + 3.0) / 2
2.5
>>> 2 + 3 / 2.0
3.5
 
Carpetsmoker said:
Getting a postfix calculator is on the TODO list ...

Get an HP scientific one with RPN (Reverse Polish Notation). There's no equals sign, and it is wonderful once you get used to it. I assume they are still made...
 
Back
Top