Samual Sam has Published 2492 Articles

lcg_value() function in PHP

Samual Sam

Samual Sam

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

30 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.1374706663408Read More

mt_getrandmax() function in PHP

Samual Sam

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

mt_srand() function in PHP

Samual Sam

Samual Sam

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

50 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

deg2rad() function in PHP

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:48:34

78 Views

The deg2rad() function converts degree to radian value. It Returns the radian equivalent of the specified degree value.Syntaxdeg2rad(num)Parametersnum − The degree value to be converted to radian.ReturnThe deg2rad() function Returns the radian equivalent of the specified degree value.Example Live DemoOutput360 degrees converted to 6.2831853071796 radians!Let us see another example −Example Live DemoOutput0.785398163397451.57079632679493.14159265358984.71238898038476.2831853071796Read More

expm1() function in PHP

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:47:39

29 Views

The expm1() function Returns e raised to the power x - 1 i.eex -1Syntaxexpm1(val)Parametersval − This is the powerReturnThe expm1() function Returns e raised to the power x - 1Example Live DemoOutput01.718281828459Let us see another example −Example Live DemoOutpute^1-1 = 1.718281828459

fmod() function in PHP

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:46:50

146 Views

The fmod() function Returns the modulo of dividend/ divisor. Floating modulo in fmod.Syntaxfmod(dividend/ divisor)Parametersdividend − The number to be divided.divisor − This is the number that divides.ReturnThe fmod() function Returns the remainder of dividend/ divisor.Example Live DemoOutput3

hypot() function in PHP

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:45:55

65 Views

The hypot() function is used to calculate the hypotenuse of a right-angle triangle. It Returns the length of the hypotenuse in float. Of a right-angled triangle, the longest side is hypotenuse.Syntaxhypot(a, b)Parametersa − Length of first sideb − Length of second sideReturnThe hypot() function Returns the length of the hypotenuse ... Read More

is_infinite() function in PHP

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:44:22

32 Views

The is_infinite() function checks if a value is infinite or not. It Returns true if num is an infinite number, else it Returns false.Syntaxis_infinite(num)Parametersnum − The number to be checked.ReturnThe is_infinite() function Returns true if num is an infinite number, else it Returns false.ExampleExample Live DemoOutput1Read More

dechex() function in PHP

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:41:43

34 Views

The dechex() function converts decimal to hexadecimal. It Returns the hexadecimal string of the specified decimal.Syntaxdechex(num)Parametersnum − The decimal value to be convertedReturnThe dechex() function Returns the hexadecimal string of the specified decimal.Example Live DemoOutputf7c6

Java Program to replace all occurrences of given String with new one

Samual Sam

Samual Sam

Updated on 26-Jun-2020 09:38:42

203 Views

User replaceAll() method to replace all occurrences of a given string. Let’s say the following is our string.String str = "THIS IS DEMO LINE AND NEW LINE!";Here, we are replacing all occurrences of string “LINE” to “TEXT”str.replaceAll("LINE", "TEXT");The following is the final example.Example Live Demopublic class Demo {    public static void main(String[] args) {       String str = "THIS ... Read More

Advertisements