Top "Bc" questions

bc is an arbitrary precision calculator language used in shell scripting.

bc truncate floating point number

How do I truncate a floating point number using bc e.g if I do echo '4.2-1.3' | bc …

linux bash bc
How to get a decimal number when dividing in bc?

I need 'bc' to divide a number and give me not only the floor but also the remainder. For instance …

unix bc
Rounding Numbers with bc in Bash

I want to compute an average with 3 decimal figures, rounded to nearest, using bc. For example: average of 3, 3 and 5 should …

linux bash bc
How can I calculate pi using Bash command

I am learning bash scripting. While exploring the math functions i am came across a command which calculated the value …

bash shell seq bc
BC command not working in CYGWIN

I have downloaded CygWin(32-bit) and installed (on Windows 7 32 bit System) today to run shell script but i found one …

cygwin bc
How to compare two floating-point values in shell script

I had to do a division in shell script and the best way was: result1=`echo "scale=3; ($var1 / $total) * 100"| bc …

linux comparison shell conditional-statements bc
Bash programmation (Cygwin): Illegal Character ^M

I have a problem with a character. I think it's a conversion problem between dos and unix. I have a …

windows bash cygwin bc
Using fractional exponent with bc

bc, a Linux command-line calculator, is proficient enough to calculate 3^2 9 Even a negative exponent doesn't confuse it: 3^-2 0.11111 Yet it …

exponent sqrt bc
modify value's in CSV with bash-script

I've the following CSV file's: 2012-07-12 15:30:09; 353.2 2012-07-12 15:45:08; 347.4 2012-07-12 16:00:08; 197.6 2012-07-12 16:15:08; 308.2 2012-07-12 16:30:09; 352.6 What I want to do …

bash csv sh bc
bc: get the sum of a list of num

Jack 10 J 10 A 20 Lu cal 20 A bc U 20 I want to get the sum of these nums: 10+10+20+20+20 = 80 but I can't …

unix bc