Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasmun committed Sep 16, 2021
1 parent 760cb20 commit 6b61160
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions FedoraScripts/bcmath
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ EOF
hyp=$(hypotenuse 3.68 7.31)
echo "hypotenuse = $hyp" # 8.184039344

function progressbar # Calculate hypotenuse of a right triangle.
{ # c = sqrt( a^2 + b^2 )
function progressbar # Perform division of two numbers
{ # c = a / b
progress=$(bc -l << EOF
scale = 24
$1 / $2
Expand All @@ -26,5 +26,14 @@ EOF
echo "$progress"
}

progress=$(progressbar 1 360)
echo -ne "progress = $progress" # 8.184039344
num=1
progress=$(progressbar $num 360)
echo -ne "progress = $progress\r"

num=$(($num + 1))
progress=$(progressbar $num 360)
echo -ne "progress = $progress\r"

num=$(($num + 1))
progress=$(progressbar $num 360)
echo -e "progress = $progress"

0 comments on commit 6b61160

Please sign in to comment.