-
-
Save mhoffman/145a97d2e587c5a0a14a189bc83968eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Turn scientic notation of rational number | |
in="$(echo ${*} | sed -e 's/\([0-9.]\)[eE]\([0-9+-]\)/\1*10^\2/g' -e 's/--/+/g' )" | |
# calculate and turn back to scientific notation | |
printf "%.7f\n" $(echo "scale=63; ${in}" | bc ;exit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment