Easy-to-use calculator under Linux BC

Source: Internet
Author: User
Tags mathematical functions

1. About BC
BC is a discretionary precision calculator language, usually under Linux as a calculator, easy to use. Equivalent to a calculator under Windows.
2. Supported operators
Main Mathematical Operations: + addition-Subtraction * Multiplication/division ^ exponent% remainder
expressions, logical operations, and mathematical functions are also supported.
3. Use
Enter BC under Linux
Then enter the operation, press ENTER to output the result of the operation
2+573*4127-252^386%513/40
In the example above, 3/4 is 0.BC the default output is an integer, to display the decimal point, set by Scale=number, number is the digit after the decimal point.
scale=33/4.750
Ability to enter multiple operations at once, according to semicolons, to separate, press ENTER to return once.
2+5;3*4;3*100712300
Numerical comparison
3 > 403 > 21
Logical Expressions
(3> 2) | | (1 < 2) 1 (3> 2) && (1 > 2) 0

Enter quit to exit
3. Through the pipeline
BC supports incoming parameters. Use the pipeline below to try it out.
$ echo "3+4" | Bc7
semicolon; separate input multiple
$ echo "3/4;SCALE=3;3/4" | BC 0.750

Address: http://blog.csdn.net/yonggang7/article/details/37317571

Easy-to-use calculator under Linux BC

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.