Home  >  Article  >  Backend Development  >  Bash program to find A raised to the power B?

Bash program to find A raised to the power B?

王林
王林forward
2023-08-30 21:01:061324browse

Bash program to find A raised to the power B?

Here we will see how to get the number A raised to the power B using a bash script. The logic is simple. We have to use the "**" operator or the power operator to do this. Let us see the following program to understand this concept clearly.

Example

#!/bin/bash
# GNU bash Script
a=5
b=6
echo "$(($a ** $b))"

Output

15625

The above is the detailed content of Bash program to find A raised to the power B?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete