Lecture12-12_11266_math library functions.ppt - Outline \u2022 Math library functions \u00a9LPU CSE101 C Programming C Standard Library \u2022 Every

Lecture12-12_11266_math library functions.ppt - Outline...

This preview shows page 1 - 6 out of 9 pages.

©LPU CSE101 C Programming Outline Math library functions
Image of page 1
©LPU CSE101 C Programming C Standard Library Every implementation of C comes with a standard library of predefined functions. Note that, in programming, a library is a collection of functions . The functions that are common to all versions of C are known as the C Standard Library .
Image of page 2
©LPU CSE101 C Programming Math Library Functions Math library functions perform common mathematical calculations #include <math.h> Format for calling maths functions functionName( argument ); If multiple arguments, use comma-separated list Example: printf( "%f", sqrt( 900 ) ); Calls function sqrt , which returns the square root of its argument All math functions return data type double Arguments may be constants, variables, or expressions
Image of page 3
©LPU CSE101 C Programming Math Library Functions
Image of page 4
©LPU CSE101 C Programming Math Library Functions: pow() The power function, pow(x,y) , calculates x y ; that is, the value of pow(x,y) = x y .
Image of page 5
Image of page 6

You've reached the end of your free preview.

Want to read all 9 pages?

  • Fall '14
  • gauravtak
  • C Programming, Continuous function, C standard library, fabs

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture