help-bash
[Top][All Lists]
Advanced

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

Floating point computations


From: steve-humphreys
Subject: Floating point computations
Date: Tue, 20 Apr 2021 22:07:40 +0200

Want to use a function for doing mathematical computations as
follows.

mtk ()
  {
    s=`echo "$@" | bc -l`
    echo "$s"
  }

$(mtk "15.6+299.33*2.3/7.4")
$(mtk "scale=5; 15.6+299.33*2.3/7.4")

I get

susa-mtk-test.sh
108.63500000000000000000
./susa-mtk-test.sh: line 67: 108.63500: command not found
susa-mtk-test.sh ends here








reply via email to

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