Floating Point calculator in Linux Shell learning-Bash

Source: Internet
Author: User
Tags ibase
Linux bash calculator is easy to use, at least it is easier to be lazy.

How:

1. Use the command line
# Scale indicates the exact number of digits of a floating point.
[Root @ hostname ~] # BC
BC 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 '.
3 + 4
7
Scale = 2; 3/4
. 75

CTRL + d

2. Unified Computing Through computing documents
[Root @ hostname ~] # Vi Calc. BC
[Root @ hostname ~] # Cat Calc. BC
3 + 4
Scale = 2; 3/4
[Root @ hostname ~] # BC Calc. BC
BC 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 '.
7
. 75

CTRL + d

3. Digital Conversion
# IBASE refers to the input number system and obase refers to the output number system.
[Root @ hostname ~] # Echo 'ibase = 10; obase = 2; 11' | BC

1011

Reference:

Http://www.linuxidc.com/Linux/2012-01/52386p2.htm

Https://writer.zoho.com/public/6b6a49b6dcbb8205336873dd09e1b3517a451cd1e1176acb0d0771c7b061b3176db04614eed231e5

Related Article

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.