help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] floating point arithmetic


From: João Eiras
Subject: Re: [Help-bash] floating point arithmetic
Date: Tue, 31 Oct 2017 01:32:26 +0100

I have my own little bash script for this use case:

$ cat calc
IFS=""
awk "BEGIN { print (${*:-0}); }" /dev/null

$ calc "2.3-5.4"


On 30 October 2017 at 22:04, Barry Walker <address@hidden> wrote:
> Hi Jerry...
>
>> I was told that "bash" does not support floating point arithmetic. I was
>> wondering if there are any plans to change that in future releases?
>
> If you are running CygWin then bc and dc are NOT part of a default install.
> However all *NIX type systems have awk which can do floating point along with
> some mathematical functions...
>
> man awk:
>
> https://www.freebsd.org/cgi/man.cgi?query=awk&sektion=1
>
>
> --
> 73...
>
> Bazza, G0LCU...
>
> Team AMIGA...
>
> The less that I speak, the smarter I sound.
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]