This is a discussion on Mathematical functions in PHP within the PHP Programming forums, part of the Web Development category; The deg2rad() function converts a degree to its radian number. <?php echo deg2rad("30") . "<br /&...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| The deg2rad() function converts a degree to its radian number. <?php echo deg2rad("30") . "<br />"; echo deg2rad("10") . "<br />"; echo deg2rad("1587") . "<br />"; echo deg2rad("70"); ?> The output of the code above will be: 0.523598775598 0.174532925199 27.6983752292 1.2217304764 |
| Sponsored Links |
| |||
| Quote:
What is the exact difference between mt_srand() and rand()?
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| The mt_rand() function returns a random integer using the Mersenne Twister algorithm. If this function is called without parameters, it returns a pseudo-random value between 0 and RAND_MAX. If you want a random number between 10 and 100 (inclusive), use mt_rand (10,100). <?php echo(mt_rand() . "<br />"); echo(mt_rand() . "<br />"); echo(mt_rand(10,100)) ?> The output of the code above could be: 1150905288 613289478 21
__________________ Thanks & Regards, Jegan CBK "We will either find a way, or make one!” |
| |||
| The tanh() function returns the hyperbolic tangent of an angle (equivalent to sinh(x) / cosh(x)). <?php echo(tanh(M_PI_4) . "<br />"); echo(tanh(0.50) . "<br />"); echo(tanh(-0.50) . "<br />"); echo(tanh(5) . "<br />"); echo(tanh(10) . "<br />"); echo(tanh(-5) . "<br />"); echo(tanh(-10)) ?> The output of the code above will be: 0.655794202633 0.46211715726 -0.46211715726 0.999909204263 0.999999995878 -0.999909204263 -0.999999995878
__________________ Thanks & Regards, Jegan CBK "We will either find a way, or make one!” |
| |||
| The log1p() function returns log(1+x), computed in a way that is accurate even when the value of x is close to zero.
__________________ Thanks & Regards, Jegan CBK "We will either find a way, or make one!” |
| |||
| first of all thanks tell about lodp() function . please give the example of log1p() function. |
| |||
| The math functions can handle values within the range of integer and float types. I hope without these functions, we can't do the calculation
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| I wondered if the switch condition would overall be less efficient if there were a large number of switch statements within a script, instead of a single switch construct with many cases. The thinking was that the switch condition was possibly more expensive to setup than an if-else. However, in this case, many switch statements still performed faster (around 25% more) than when using many if-else or if,if conditionals instead.
__________________ With, J. Jeyaseelan Everything Possible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| COM functions in php | Kamalakannan | PHP Programming | 24 | 07-12-2008 03:20 AM |
| PHP FTP Functions | Kamalakannan | PHP Programming | 54 | 04-14-2008 04:42 AM |
| erroneous results for certain mathematical calculations | aramesh | Flash Actionscript Programming | 1 | 04-03-2008 02:00 AM |
| Sql functions | itbarota | Database Support | 11 | 02-29-2008 01:08 AM |
| What are Virtual Functions? How to implement virtual functions in "C"? | Sabari | C and C++ Programming | 4 | 09-10-2007 10:35 PM |