515Chapter 27MathematicsSomewhat more satisfyingly, evaluating: print( The square (Web design templates) root

515Chapter 27MathematicsSomewhat more satisfyingly, evaluating: print( The square root of two is . bcsqrt(2, 40)); gives us many more digits of precision than we could get using doubles: The square root of two is 1.4142135623730950488016887242096980785696SummaryAlthough the primary purpose of PHP is not to do mathematics, it has a pretty comprehen- sive set of mathematical functions covering basic arithmetic, pseudo-random number genera- tion, base conversion, trigonometry, exponents and logarithms, and a built-in module fordoing arbitrary-precision arithmetic. We covered the numerical types and the most basic functions in Chapter 10, and covered theremaining topics in this chapter. Table 27-6 is a tabular summary of the operators and func- tions discussed both in Chapter 10 and this chapter. Table 27-6: Summary of PHP Math Operators and FunctionsCategoryDescriptionArithmetic operatorsOperators +, -, *, /, %perform basic arithmetic on integers anddoubles. Incrementing operatorsThe ++and –operators change the values of numericalvariables, increasing them by one or decreasing them by one(respectively). The value of the postincrement form ($var++) is the same as the variable s value before the change; the valueof the preincrement form (++$var) is the variable s value afterthe change. Assignment operatorsEach arithmetic operator (like +) has a correspondingassignment operator (+=). The expression $count += 5isequivalent to $count = $count + 5. Comparison operatorsThese operators (<, <=,>, >=, ==, !=) compare two numbersand return either trueor false. The ===operator is true ifand only if its arguments are equal and of the same type. Basic math functionsfloor(), ceil(), and round() convert doubles to integers, min()and max()take the minimum and maximum of theirnumerical arguments, and abs()is the absolute value function. Base conversion functionsSpecial-purpose functions (OctDec(), DecOct(), BinDec(), DecBin(), HexDec(),DecHex()) convert betweenparticular pairs of bases, whereas base_convert()translatesbetween arbitrary bases. Continued31
Note: If you are looking for reliable webhost to maintain and run your java application check Vision java hosting services

Leave a Reply