C++ Math pow()
This function is used to find the power of a given number.
Consider a base 'b' and exponent 'e'.
Its syntax would be :
Note: If any argument is of long double type, then the return type is promoted to long double. If not, then the return type is promoted to double.
b: 'b' is the number, whose power is to be calculated.
e: 'e' is the exponent.
It returns the base 'b'raised to the power 'e'.
Let's see a simple example when both base and exponent are of integer type.
Power of a given number is :16
Let's see a example when base is of float type and exponent is of integer type.
Power of a given number is :64
Let's see a simple example when both base and exponent are of float type..
Power of a given number is :4
Next TopicC++ Math Functions
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week