First, frequently asked questionsWhen using PHP for computing, you often encounter the problem of precision, the following two common examples:1. Comparison of operationsThe result of the following expression output is not 相等 :2. Type conversionThe
This article directory:1.6.1 Basic Integer Arithmetic1.6.2 BC Command Advanced arithmetic operationsuse Let, $ (()), or $[] for basic integer operations, using BC for advanced operations, including decimal operations. Where the expr command can also
Abstract:
1) The Linux shell uses let, [], (()) Three operators to manipulate shell variables for simple basic operations;
2) The Linux shell uses expr and BC two programs to achieve advanced operations;
1, basic operation of Linux
"Purpose description"
Bash has built-in support for integer arithmetic, but does not support floating-point operations, and the BC Command makes it easy to do floating-point operations, and of course integer operations are no longer spoken. The man
Magic Calculator for DC and BCLinux is the P244.Http://baike.baidu.com/link?url= Ylttivbfc1tfzreeuqoe8d0c6yqwbzgqnmlobq1hjvadxxlatniwkkhli9u-4txwd4cuxos6oqnwiesmyoxulue_zhko3fevdzbnxhi4xpgDC old, is the abbreviation of desk caclulator, use inverse
BC is an advanced tool for mathematical operations and contains a number of options for performing floating-point arithmetic and applying some advanced functions:[Email protected] ~]# echo 3*2.12 | Bc6.36[[email protected] ~]# n=54[[email protected]
BC Math function Table of Contents
Bcadd -Addition calculation of 2 arbitrary precision numbers
Bccomp -Compare two arbitrary-precision numbers
Bcdiv -2 digit division calculation with arbitrary Precision
Bcmod -modulo an
If you need a calculator in a graphical desktop environment, you may only need to click on it all the way to find a calculator. For example, a tool named is already included in the Fedora workstation Calculator . It has several different modes of
Description of UseBash has built-in support for integer arithmetic, but it does not support floating-point operations, and the BC command can be very handy for floating-point operations, and of course integer arithmetic is no longer spoken. The
Share a command-line calculator - BCIf you need a calculator in a graphical desktop environment, you may only need to click on it all the way to find a calculator. For example, a tool called Calculator is already included in theFedora workstation .
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.