Advertisement
FaisalAhemdBijoy

bc command

Sep 16th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. echo bc command
  2.  
  3. num1=10
  4. num2=15
  5.  
  6. echo $num1+$num2
  7. echo "$num1+$num2"
  8. echo $((num1+num2))
  9.  
  10. echo bc command int
  11. echo $num1+$num2 | bc
  12. echo $num1-$num2 | bc
  13. echo $num1*$num2 | bc
  14. echo $num1/$num2 | bc
  15.  
  16.  
  17. num1=100.5
  18. num2=75
  19.  
  20. echo bc command arithmetic
  21. echo $num1+$num2 | bc
  22. echo $num1-$num2 | bc
  23. echo $num1*$num2 | bc
  24. echo $num1/$num2 | bc
  25.  
  26. echo bc command math module
  27.  
  28. num=27
  29. echo "scale=4;sqrt($num)" | bc
  30. echo "scale=5;3^3" | bc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement