From the course: C Standard Library
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Powers and exponentials example - C Tutorial
From the course: C Standard Library
Powers and exponentials example
- [Narrator] This will be another very simple example where I'll show you these functions. So I will do that in a series of printf statements. Let me first write, for example, three raised to the fourth power equals this value. So I will call the pow function which uses the base and the exponent as arguments. So I'll use 3.0 and 4.0. Let's break a line here, and let's see how this looks. And we get that three raised to the fourth power equals 81, which seems about right. Now, let's see some other functions. Let's now see the exponential function. And let's use something that we can identify. So let's use the exp2 function. So this one raises two to some power. So let's say, two raised to the tenth power equals this number. So again I will raise two to the tenth power. Let's see how it looks. And we got that two to the tenth power is 1,024. So notice how the power function is different from the exp2 function because exp2 uses two as the base and by the way, exp uses 10 as the base but…
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
-
(Locked)
Rounding and truncating51s
-
(Locked)
Rounding and truncating example5m 4s
-
(Locked)
Trigonometric functions1m 42s
-
(Locked)
Trigonometric functions example1m 27s
-
(Locked)
Powers and exponentials1m 9s
-
(Locked)
Powers and exponentials example3m 4s
-
(Locked)
Challenge: Polar coordinate conversion2m 19s
-
(Locked)
Solution: Polar coordinate conversion6m 53s
-
(Locked)
C23 update3m 39s
-
-