Found 34488 Articles for Programming

mt_srand() function in PHP

Samual Sam
Updated on 26-Jun-2020 09:49:42

52 Views

The mt_srand() function seeds the Mersenne Twister random number generator.Note − Random number generator is seeded automatically after the release of PHP 4.2.0. This function is not needed now.Syntaxmt_srand(seed)Parametersseed − The seed valueReturnThe mt_srand() function Returns nothing.Example Live DemoOutput1320295657

mt_rand() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 06:56:17

58 Views

The mt_rand() function is used to generate random numbers. The numbers are generated using the Mersenne Twister algorithm.Note − This function is faster than the rand() functionSyntaxmt_rand() or mt_rand(min, max)Parametersmin − Default is 0.The lowest number to be Returned.max − The highest number to be Returned.ReturnThe mt_rand() function Returns a random integer between min (or 0) and max. FALSE is Returned if max < min.Example Live DemoOutput144ExampleLet us see another example − Live DemoOutput132850920

mt_getrandmax() function in PHP

Samual Sam
Updated on 26-Jun-2020 09:50:15

22 Views

The mt_getrandmax() function Returns the largest possible random value.Syntaxmt_getrandmax()ParametersNAReturnThe mt_getrandmax() function Returns an integer value, which is the largest possible random value.Example Live DemoOutput2147483647

min() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 06:55:31

90 Views

The min() function Returns the minimum value of an array.Syntaxmin(arr_values); or min(val1,val2,...);Parametersarr_values − The array with values.val1, val2 − The values to compare.ReturnThe min() function Returns the minimum value of an array.Example Live DemoOutput12ExampleLet us see another example − Live DemoOutput12

max() function in PHP

Samual Sam
Updated on 27-Dec-2019 06:53:28

113 Views

The max() function Returns the maximum value of an array.Syntaxmax(arr_values); or max(val1,val2,...);Parametersarr_values − The array with values.val1, val2 − The values to compare.ReturnThe max() function Returns the maximum value of an array.Example Live DemoOutput89ExampleLet us see another example − Live DemoOutput89

log1p() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 06:52:28

71 Views

The log1p() function Returns log(1+number), computed in a way that is accurate even when the value of number is close to zero.Syntaxlog1p(val)Parametersval − The specified numberReturnThe log1p() function Returns log(1+number), computed in a way that is accurate even when the value of number is close to zero.Example Live DemoOutput0.69314718055995ExampleLet us see another example − Live DemoOutput0ExampleLet us see another example − Live DemoOutput2.39789527279841.3083328196502

log10() function in PHP

Samual Sam
Updated on 27-Dec-2019 06:51:22

59 Views

The log10() function Return the base-10 logarithm of a number.Syntaxlog10(num)Parametersnum − The value to calculate the logarithm for.ReturnThe log10() function Returns base 10 logarithm of a number.Example Live DemoOutput0ExampleLet us see another example − Live DemoOutput-INFExampleLet us see another example − Live DemoOutput10.43136376415899

log() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 06:49:59

166 Views

The log() function Returns the natural logarithm of a number.Syntaxlog(num, base)Parametersnum − The value for which you want to calculate the logarithmbase − The logarithmic baseReturnThe log() function Returns the natural logarithm of a number.Example Live DemoOutput0ExampleLet us see another example − Live DemoOutput-INFExampleLet us see another example − Live DemoOutput2.3025850929940.99325177301028

lcg_value() function in PHP

Samual Sam
Updated on 26-Jun-2020 09:51:36

32 Views

The lcg_value() function Returns a pseudo random number in the range 0 - 1Syntaxlcg_value()ParametersReturnThe lcg_value() function Returns a pseudo random float value in the range 0 - 1.Example Live DemoOutput0.42510822828987Let us see another example generating different values every time lgc_value() function is used.Example Live DemoOutput0.0016752472603958 0.95593815480995 0.57392418877843 0.1374706663408

is_nan() function in PHP

karthikeya Boyini
Updated on 26-Jun-2020 09:51:50

51 Views

The is_nan() function checks for ‘not a number’ value. It Returns TRUE if num is 'not a number', else FALSE is Returned.Syntaxis_nan(num)Parametersnum − The value to checkReturnThe is_nan() function Returns TRUE if num is 'not a number', else FALSE is Returned.ExampleLet us see another example −Example

Advertisements