#C14926. Power Calculation Without Built-in Functions
Power Calculation Without Built-in Functions
Power Calculation Without Built-in Functions
You are given a base (a floating-point number) and an exponent (an integer). Your task is to compute (base^{exponent}) using an iterative multiplication method without using any built-in power functions or operators. The solution should correctly handle positive exponents, negative exponents (by taking the reciprocal), and a zero exponent. This is a typical implementation problem that tests your ability to work with loops and conditional statements in a programming environment.
inputFormat
The input is provided as a single line from standard input containing two values separated by whitespace. The first value is a floating-point number (base) and the second value is an integer (exponent).
outputFormat
Output the result of the calculation (base^{exponent}) as a floating-point number to standard output.## sample
2.0 3
8.0