Arithmetic Operations

Sort by

recency

|

236 Discussions

|

  • + 0 comments

    SOLVED

    start of script

    !/bin/bash

    read expression result=expression" | bc -l) rounded_res=result") echo $rounded_res

  • + 0 comments

    read expr

    result=expr" | bc -l)

    printf "%.3f\n" "$result"

  • + 0 comments

    read input printf "%.3f\n" echo "$input" | bc -l

  • + 0 comments

    this works totally fine

    result=$(echo "$expression" | bc -l)
    printf "%.3f\n" "$result"
    
  • + 0 comments

    It will work, just a little trick

    read expression

    result=expression" | bc -l)

    if [ result fi