Programming Articles

Page 26 of 2546

PHP decbin() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 295 Views

Definition and UsageThe decbin() function returns a string that contains binary equivalent of given decimal number argument.This function returns a string with binary digits.Syntaxdecbin ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent binary representationReturn ValuesPHP decbin() function returns a binary number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result −decbin(-10) = 1111111111111111111111111111111111111111111111111111111111110110

Read More

PHP dechex() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 245 Views

Definition and UsageThe dechex() function returns a string that contains hexadecimal equivalent of given decimal number argument.This function returns a string with hexadecimal characters.Syntaxdechex ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent hexadecimal representationReturn ValuesPHP dechex() function returns a hexadecimal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result −dechex(-10) = fffffffffffffff6

Read More

PHP deg2rad() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 298 Views

Definition and UsageMost trigonometric functions like sin, cos, tan etc require angle argument in radians. The deg2rad() function proves useful in conversion of degrees to radians.This function returns a float number such that number=deg2rad(x) where is angle in degrees. angle in radian = angle in deg *180/piFor example deg2rad(30) is equal to 0.5235987755983 radiansSyntaxdeg2rad ( float $number ) : floatParametersSr.NoParameter & Description1numberA float number reprsenting angle in degreesReturn ValuesPHP deg2rad() function returns a float number that represents angle in radians.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result −deg2rad(45) ...

Read More

PHP expm1() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 138 Views

Definition and UsageThe expm1() function returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero, a case where 'exp (number) - 1' would be inaccurate due to subtraction of two numbers that are nearly equal.expm1(x) = exp(x) - 1This function returns a float value .Syntaxexpm1 ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point number whose expm1 is to be calculated.Return ValuesPHP expm1() function returns a floating point value.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result ...

Read More

PHP floor() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 830 Views

Definition and UsageThe floor() function is another in-built function in PHP iterpreter. This function accepts any float number as argument and rounds it down to the next lowest integer.This function always returns a float number as range of float is bigger than that of integer.Syntaxfloor ( float $num ) : floatParametersSr.NoParameter & Description1numThe number to be rounded down.Return ValuesPHP floor() function returns the largest integer less than or equal to given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result −floor(-3.95) = -4

Read More

PHP getrandmax() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 261 Views

Definition and UsageThe getrandmax() function returns largest integer that can be used in PHP. Value returned by this function serves as the upper limit for rand() function to generate random number.This function always returns an integer.Syntaxgetrandmax ( void ) : intParametersSr.NoParameter & Description1This function needs no parametersReturn ValuesPHP getrandmax() function returns largest possible integer that can be used in PHP. On 64 bit Windows, the number is 2147483647PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis may produce following result (it being a random number, it is more likely to return different number ...

Read More

PHP hexdec() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 180 Views

Definition and UsageThe hexdec() function returns a decimal number equivalent of a hexadecimal number embedded in a string.This function returns a a decimal integer, though larger values may result in floats.Syntaxhexdec ( string $hex_string ) : numberParametersSr.NoParameter & Description1hex_stringA decimal number to be converted in equivalent octal representationReturn ValuesPHP hexdec() function returns a decimal number.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result −hexdec(-10) = 16

Read More

How to extract the factor levels from factor column in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 13K+ Views

To extract the factor levels from factor column, we can simply use levels function. For example, if we have a data frame called df that contains a factor column defined with x then the levels of factor levels in x can be extracted by using the command levels(df$x). This extraction is helpful if we have a large number of levels.Example1x2

Read More

PHP is_nan() Function

Malhar Lathkar
Malhar Lathkar
Updated on 11-Mar-2026 962 Views

Definition and UsageNAN stands for "Not A Number". The is_nan() function checks whether its argument is not a number.Syntaxis_nan ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if infinite or notReturn ValuesPHP is_nan() function returns TRUE if val is "not a number", otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.ExampleOutputThis will produce following result −float(NAN) bool(true)

Read More

How to create bar chart based on two groups in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 717 Views

To create a bar chart based on two groups, we can use geom_bar function of ggplot2 package with position argument that defines the position of the groups. For example, if we have a data frame called df that contains two categorical variable x1 and x2 and the one response variable y then the bar chart can be created by using the below command −ggplot(df,aes(x1,y,fill=x2))+geom_bar(position=position_dodge(),stat="identity")Examplelibrary(ggplot2) ggplot(df,aes(Age_Group,Y,fill=Gender))+geom_bar(position=position_dodge(),stat="identity")Output

Read More
Showing 251–260 of 25,451 articles
« Prev 1 24 25 26 27 28 2546 Next »
Advertisements