Page 267 - Computer Software Application TP - Volume 1
P. 267

COMPUTER SOFTWARE APPLICATION - CITS







































           TASK 7: Common math functions

              Basic Arithmetic Functions:
              abs($number): Returns the absolute (positive) value of a number.
              round($number, $precision = 0): Rounds a number to a specified number of decimal places.
              ceil($number): Rounds a number up to the nearest integer.
              floor($number): Rounds a number down to the nearest integer.
              min($number1, $number2, ...): Returns the smallest value from a list of numbers.
              max($number1, $number2, ...): Returns the largest value from a list of numbers.
              pow($base, $exponent): Returns the base raised to the power of the exponent.
              sqrt($number): Returns the square root of a number.
              Trigonometric Functions:
              sin($angle): Returns the sine of an angle in radians.
              cos($angle): Returns the cosine of an angle in radians.
              tan($angle): Returns the tangent of an angle in radians.
              asin($number): Returns the arcsine of a number (in radians).
              acos($number): Returns the arccosine of a number (in radians).
              atan($number): Returns the arctangent of a number (in radians).

              Logarithmic Functions:
              log($number, $base = M_E): Returns the logarithm of a number to a specified base (default is natural
              logarithm, base e).
              exp($number): Returns the value of e raised to the power of a number.

              Number Base Conversion Functions:
              base_convert($number, $frombase, $tobase): Converts a number between arbitrary bases.
              bindec($binary_string): Converts a binary string to a decimal number.






                                                           252

                               CITS : IT & ITES - Computer Software Application - Exercise 53
   262   263   264   265   266   267   268   269   270   271   272