You can’t. bash only does integers; you must delegate to a tool such as bc
.
More Related Contents:
- How can I compare two floating point numbers in Bash?
- Floating point comparison with variable in bash [duplicate]
- Arithmetic expressions in Bash?
- bash: $[] vs. $(())
- How can I check if a program exists from a Bash script?
- How can I compare numbers in Bash?
- echo “#!” fails — “event not found”
- Pipe output and capture exit status in Bash
- Redirect stderr and stdout in Bash [duplicate]
- Which characters need to be escaped when using Bash?
- Tilde expansion in quotes
- Using variables inside a bash heredoc
- How can I exclude all “permission denied” messages from “find”?
- Remove Unicode characters from textfiles – sed , other Bash/shell methods
- How to apply shell command to each line of a command output?
- What do double-asterisk (**) wildcards mean?
- How to split strings over multiple lines in Bash?
- Creating a string variable name from the value of another string
- Passing arguments by reference
- How to limit number of threads/sub-processes used in a function in bash
- Using case for a range of numbers in Bash
- How to run some command before or after every Bash command entered from console?
- How do I remove all .pyc files from a project?
- Sorting strings with numbers in Bash [duplicate]
- What does the double-asterisk (**) wildcard mean?
- How to send control+c from a bash script?
- How to update one file in a zip archive
- Store output of sed into a variable [duplicate]
- How to redirect a program that writes to tty?
- How to loop over files in natural order in Bash?