From the course: C Standard Library
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Powers and exponentials - C Tutorial
From the course: C Standard Library
Powers and exponentials
- [Instructor] Let's now see a family of functions that involve raising a number to some power. These functions are powers and exponentials. Their inverse operations are roots and logarithms. For powers, we get the pow function, which returns the result of raising a base to an exponent. This is the doubling limitation of the function. For exponentials, we have two basic functions. Exp, which raises the constant E to the power sent as an argument, and exp2, which raises two to the power sent as an argument. There are three root calculating functions. The square root function, the cubic root function, and the hypotenuse function, which computes the square root of X squared plus Y squared. Finally, we have three basic logarithm functions. Log, which computes the base E, or natural logarithm. And we have log2 for base two, that's in the binary numbering system. And log10 for base 10, that's decimal.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Mathematical functions2m 50s
-
Rounding and truncating51s
-
Rounding and truncating example5m 4s
-
Trigonometric functions1m 42s
-
Trigonometric functions example1m 27s
-
Powers and exponentials1m 9s
-
Powers and exponentials example3m 4s
-
Challenge: Polar coordinate conversion2m 19s
-
Solution: Polar coordinate conversion6m 53s
-
C23 update3m 39s
-
-