Using bc Command

Configurare noua (How To)

Situatie

bc (Basic Calculator) is a command-line utility that provides all features you expect from a simple scientific or financial calculator. It is specifically useful for doing floating point math.

Solutie

If bc command not installed, you can install it using:

Once installed, you can run it in interactive mode or non-interactively by passing arguments to it – we will look at both case. To run it interactively, type the command bc on command prompt and start doing some math, as shown.

The following examples show how to use bc non-interactively on the command-line.

The -l flag is used to the default scale (digits after the decimal point) to 20, for example:

 

Tip solutie

Permanent

Voteaza

(20 din 39 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?