512Part IIIAdvanced Features and TechniquesTable 27-5(continued) FunctionBehaviorbcpow()Raises the (Web hosting reviews)
Wednesday, April 25th, 2007512Part IIIAdvanced Features and TechniquesTable 27-5(continued) FunctionBehaviorbcpow()Raises the first argument to the power of the second argument. The number ofdecimal places in the result is set by the scale factor if supplied. bcsqrt()Returns the square root of its argument, with number of decimal places set by theoptional scale factor. bcscale()Sets the default scale factor for subsequent BC function calls. An arbitrary-precision exampleHere s an example of using the arbitrary-precision functions for exact integer arithmetic. Thefollowing code: for ($x = 1; $x < 25; $x++) { print( $x raised to the power of $x is . bcpow($x, $x) .
); } will print like this: 1 raised to the power of 1 is 12 raised to the power of 2 is 43 raised to the power of 3 is 274 raised to the power of 4 is 2565 raised to the power of 5 is 31256 raised to the power of 6 is 466567 raised to the power of 7 is 8235438 raised to the power of 8 is 167772169 raised to the power of 9 is 38742048910 raised to the power of 10 is 1000000000011 raised to the power of 11 is 28531167061112 raised to the power of 12 is 891610044825613 raised to the power of 13 is 30287510659225314 raised to the power of 14 is 1111200682555801615 raised to the power of 15 is 43789389038085937516 raised to the power of 16 is 1844674407370955161617 raised to the power of 17 is 82724026188633676417718 raised to the power of 18 is 3934640807529653757542419 raised to the power of 19 is 197841965566031358912397920 raised to the power of 20 is 10485760000000000000000000021 raised to the power of 21 is 584258701838598252138112442122 raised to the power of 22 is 34142787736421955739664672358423 raised to the power of 23 is 2088046799984791203435503291056724 raised to the power of 24 is 133373577685028412444908147284377625 raised to the power of 25 is 88817841970012523233890533447265625If we had used the regular PHP integer type for this computation, the integers would haveoverflowedwell before the end, and the rest of the loop would have been calculated inapproximate floating point.
Note: If you are looking for cheap webhost to host and run your apache application check Vision jboss web hosting services