xxxxxxxxxx
#!usr/bin/env/bash
#Converting binary 10 to octal
bc -l <<< "ibase=2; obase=8; 10"
#Converting decimal 5 to binary
bc -l <<< "obase=2; 5"
#Using scale to control length of floating-point numbers
bc -l <<< "scale=3; a(30)"
We will get the following output:
2
101
1.537