How do you calculate?

How do you calculate?

guy keren choo at actcom.co.il
Thu May 20 16:21:14 IDT 2010


Nadav Har'El wrote:
> For years, I've been wondering: How do other Unix or Linux users do simple
> calculations?
> 
> Do you take out an actual physical calculator (which is of course ridiculous)?
> Do you use software that looks like a physical calculator (xcalc, kcalc, etc.)?
> 
> Or do you use bc? Does anyone actually use bc, which returns "0" as a result
> for the calculation "2/3"? :-) Of course, you can use "scale=10" (or the -l
> option to bc) to fix that, but how many first-time users would know that?
> What posessed the person who decided to make scale=0 the default? :-)

since i don't care for the "first timers" when _i_ need to do the 
calculations - i always use 'bc' for simple math. i use "expr" if i need 
integer math as part of a shell command. if i need something more 
complicated where i want to tweak the calculation and re-run it with 
different parameters (e.g. multi-year interest calculations) - i write a 
program in C - the last one was for calculating prospected pension 
earnings. i should learn how to use a spreadsheet for that, but i think 
there is an advantage for a C program in some situations.

--guy



More information about the Linux-il mailing list