Found 33676 Articles for Programming

pi() function in PHP

Samual Sam
Updated on 27-Dec-2019 06:57:57

138 Views

The pi() function Returns the value of Pi (π).Syntaxpi()ParametersNAReturnThe pi() function Returns the approximate value of PI. This value is a floating point value.3.1415926535898Example Live DemoOutput3.1415926535898ExampleLet us see another example to get the value of PI Live DemoOutput3.1415926535898

octdec() function in PHP

karthikeya Boyini
Updated on 27-Dec-2019 06:57:16

73 Views

The octdec() function converts octal to decimal.Syntaxoctdec(val)Parametersval − the octal string to convertReturnThe octdec() function Returns the decimal equivalent of the specified octal number.Example Live DemoOutputa80ExampleLet us see another example − Live DemoOutput120170

mt_srand() function in PHP

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

88 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

103 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

63 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

129 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

163 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

115 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

84 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

243 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

Advertisements