Mathematical Functions
:
Mathematical Functions(
C++
Math library functions((
include < cmath
C( ++
Mathematical Functions by typy:
Rounding:
1.double cell(double x) Round up
2.double flor(double x) Round down
Absolute values
1.double fabs(double x) Returns absolute value x (floating-point variable)
1. double sqrt(double x) Calculate the square root of x
2. double pow(double x) Calculate power X^y
3. double log(double x) Calculate natural logarithm Ln x
 Trigonometric functions :
1. double cos(double x) Calculate cosin of argument cos x
 Root, power, And logarithmic functions :
Mathematical Functions Example
 Ceil ( x )
1. ceil ( 9.2 ) is 10.0
2. ceil ( -9.8 ) is -9.0
 Floor ( X )
1. Floor ( 6.2 ) is 6.0 cile
2. Floor ( -6.8 ) is -7.0
 Fabs ( x )
1. Fabs (5.1) is 5.1
2. Fabs (0.0) is 0.0 X
3. Fabs (-8.76) is 8.75
 Sqrt ( X )
1. Sqrt ( 900 ) is 30 X
2. Sqrt ( 9 ) is 3
 Pow ( X , Y )
1. Pow ( 2 , 7 ) is 2^7 = 128
 Log ( X )
1. Log ( 2.719282) is 1.0 Ln
2. Log (7.389050) is 2.0
3. Cos ( X )
4. cos ( 0.0 ) is 1.0
C++
Hans petter
simular research laboratory
Dept. of informatics, of oslo
January 2006

C++ ammar .s.q

  • 1.
  • 2.
    Mathematical Functions( C++ Math libraryfunctions(( include < cmath
  • 3.
    C( ++ Mathematical Functionsby typy: Rounding: 1.double cell(double x) Round up 2.double flor(double x) Round down Absolute values 1.double fabs(double x) Returns absolute value x (floating-point variable)
  • 4.
    1. double sqrt(doublex) Calculate the square root of x 2. double pow(double x) Calculate power X^y 3. double log(double x) Calculate natural logarithm Ln x  Trigonometric functions : 1. double cos(double x) Calculate cosin of argument cos x  Root, power, And logarithmic functions :
  • 5.
    Mathematical Functions Example Ceil ( x ) 1. ceil ( 9.2 ) is 10.0 2. ceil ( -9.8 ) is -9.0  Floor ( X ) 1. Floor ( 6.2 ) is 6.0 cile 2. Floor ( -6.8 ) is -7.0  Fabs ( x ) 1. Fabs (5.1) is 5.1 2. Fabs (0.0) is 0.0 X 3. Fabs (-8.76) is 8.75
  • 6.
     Sqrt (X ) 1. Sqrt ( 900 ) is 30 X 2. Sqrt ( 9 ) is 3  Pow ( X , Y ) 1. Pow ( 2 , 7 ) is 2^7 = 128  Log ( X ) 1. Log ( 2.719282) is 1.0 Ln 2. Log (7.389050) is 2.0 3. Cos ( X ) 4. cos ( 0.0 ) is 1.0
  • 7.
  • 8.
    Hans petter simular researchlaboratory Dept. of informatics, of oslo January 2006