Known Slugs
Learn how some C functions that make our program slower.
We'll cover the following
Slow math functions
There are some C functions that are known to be slow such as the pow
and sqrt
functions, and the trigonometric functions (e.g., sin
, cos
, tan
, etc.). These can be accessed by including the math.h
header file.
However, in some cases, we can use faster alternatives. For example, instead of using the function pow
with integers, like this:
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy