The shell floating-point calculation tool bc supports floating-point numbers and is an advanced tool for mathematical operations. [Root @ localhost desktop] # bcbc 1.06 Copyright 1991-1994,199 7, 1998,200 0 Free Software Foundation, Inc. this is free software with absolutely no warranty. for details type 'warranty '. 2 + 353.5 * 2.381_ctrl + d Exit of course, bc also supports many operators, such as/*-+. It also supports variables, condition comparison operators, logical operators, judgment statements, and cyclic statements. A = 1 while (a ++ <100) sum + = asum5049 1. Set the decimal precision and use the scale parameter. [Root @ localhost desktop] # echo "scale = 5; 3/21" | bc.14285 [root @ localhost desktop] # echo "scale = 2; 3/21" | bc.14 2. hexadecimal conversion, using the parameter obase, ibase (indicating the output, in what format the input uses) [root @ localhost desktop] # william = 100; echo "obase = 2; $ william "| bc1100100 [root @ localhost desktop] # william = 100; echo" obase = 10; ibase = 2; $ william "| bc4 [root @ localhost desktop] # william = 100; echo" obase = 10; ibase = 5; $ william "| bc25 3. calculate the square root of the sum of squares [root @ localhost desktop] # echo "sqrt (100)" | bc10 [root @ localhost desktop] # echo "10 ^ 10" | bc1_000000