Shell floating-point computing tool bcbc supports floating-point numbers. it is an advanced tool for mathematical operations. [Root @ localhost desktop] # bcbc1.06Copyright1991-1994,1997, 1998,2000 FreeSoftwareFoundation, Inc. Thisisfreesoftwa... shell floating point computation 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
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.