Urmila Samariya

Urmila Samariya

108 Articles Published

Articles by Urmila Samariya

Page 6 of 11

PHP – How to subtract one arbitrary precision number from another using bcsub() function?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 890 Views

In PHP, bcsub() math function is used to subtract one arbitrary precision number from another number. The bcsub() function takes two arbitrary precision numbers as strings and returns the subtraction result after scaling to a specified precision. Syntax string bcsub($num_str1, $num_str2, $scaleVal) Parameters The bcsub() math function accepts three different parameters $num_str1, $num_str2 and $scaleVal. $num_str1 − It represents the left operand and it is the string type parameter. ...

Read More

PHP – How to compare two arbitrary precision numbers using bccomp() function?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

In PHP, the bccomp() function is used to compare two arbitrary precision numbers. It takes two numbers as strings and returns an integer indicating which number is larger, smaller, or if they are equal. Syntax int bccomp(string $left_operand, string $right_operand, int $scale = 0) Parameters The bccomp() function accepts three parameters − $left_operand − The left operand as a string representing the first number to compare. $right_operand − The right operand as a string representing the second number to compare. $scale − Optional. The number of decimal places to use in the ...

Read More

PHP – How to divide two arbitrary precision numbers using bcdiv() function?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 849 Views

In PHP, bcdiv() math function is used to divide one arbitrary precision number from another number. The bcdiv() function takes two arbitrary precision numbers as strings and returns the result as a division of two numbers after scaling the result to a specified precision. Syntax string bcdiv($num_string1, $num_string2, $scaleVal) Parameters The bcdiv() function accepts three parameters: $num_string1 − The dividend (string type parameter) $num_string2 − The divisor (string type parameter) $scaleVal − Optional integer parameter that sets the number of digits after the decimal point in the result. Default is 0 ...

Read More

PHP – How to get the modulus of an arbitrary precision number using bcmod() function?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 362 Views

In PHP, bcmod() math function is used to calculate the modulus of an arbitrary precision number. The bcmod() function takes arbitrary precision numbers as strings and returns the remainder after dividing the dividend by the divisor. Unless the divisor is 0, the result has the same sign as the dividend. Syntax bcmod(string $dividend, string $divisor[, int $scale = 0]) Note − The scale parameter was added from PHP 7.2.0 version. Parameters The bcmod() function accepts the following parameters ? $dividend − The dividend that is divided by ...

Read More

PHP – How to multiply two arbitrary precision numbers using bcmul() function?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 1K+ Views

In PHP, bcmul() function is used to multiply two arbitrary precision numbers. This function is particularly useful when dealing with very large numbers or when you need precise decimal calculations that exceed PHP's floating-point precision limits. Syntax string bcmul(string $num1, string $num2, ?int $scale = null) Parameters The bcmul() function accepts three parameters − $num1 − The left operand as a string representing an arbitrary precision number. $num2 − The right operand as a string representing an arbitrary precision number. $scale − Optional integer parameter that sets the number of decimal places ...

Read More

PHP – How to add two arbitrary precision numbers using bcadd() function?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 509 Views

In PHP, bcadd() math function is used to add two arbitrary precision numbers. The bcadd() function takes two arbitrary precision numbers as strings and returns their sum, scaling the result to a specified precision. Syntax string bcadd(string $num1, string $num2, int $scale = 0) Parameters The bcadd() function accepts three parameters − $num1 − The left operand as a string representing an arbitrary precision number. $num2 − The right operand as a string representing an arbitrary precision number. $scale − ...

Read More

How to get an affine transformation matrix in PHP using imageaffinematrixget()?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 232 Views

The imageaffinematrixget() function is an inbuilt PHP function that generates an affine transformation matrix. This function is commonly used in computer graphics and image processing to define transformations like scaling, rotation, translation, and shearing ? Note: This function requires the GD extension to be installed in PHP. Syntax array imageaffinematrixget(int $type, mixed $options) Parameters The function accepts two parameters ? $type − An integer constant that specifies the transformation type: IMG_AFFINE_TRANSLATE − Translation (movement) IMG_AFFINE_SCALE − Scaling (resize) IMG_AFFINE_ROTATE − Rotation IMG_AFFINE_SHEAR_HORIZONTAL − Horizontal shearing IMG_AFFINE_SHEAR_VERTICAL − Vertical ...

Read More

How to check antialias functions be used or not by using imageantialias() function in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 188 Views

The imageantialias() function is an inbuilt PHP function that enables or disables antialiasing for drawing operations. It activates fast drawing anti-aliased methods for lines and wired polygons, working only with true-color images without alpha component support. Syntax bool imageantialias($image, $enabled) Parameters The imageantialias() function takes two parameters: $image − A GdImage object or image resource created by image creation functions like imagecreatetruecolor(). $enabled − A boolean value that enables (true) or disables (false) antialiasing. Return Value Returns true on success or false on failure. Example Here's how ...

Read More

How to apply a 3×3 convolution matrix using imageconvolution() in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 294 Views

The imageconvolution() function is an inbuilt function in PHP that applies a 3×3 convolution matrix to an image using coefficients and offset values. This function is commonly used for image filtering effects like blur, sharpening, and edge detection. Syntax bool imageconvolution($image, $matrix, $div, $offset) Parameters The imageconvolution() function accepts four parameters: $image − A GD image resource created using image creation functions like imagecreatetruecolor() $matrix − A 3×3 array containing float values representing the convolution kernel $div − The divisor used for normalization ...

Read More

How to apply a gamma correction to a Graphics Draw (GD) image in PHP?

Urmila Samariya
Urmila Samariya
Updated on 15-Mar-2026 251 Views

The imagegammacorrect() function is an inbuilt PHP function that applies gamma correction to a Graphics Draw (GD) image. Gamma correction adjusts the brightness and contrast of an image by modifying the relationship between input and output pixel values. Syntax bool imagegammacorrect(resource $image, float $inputgamma, float $outputgamma) Parameters The imagegammacorrect() function takes three parameters ? $image − The image resource to apply gamma correction to $inputgamma − The input gamma value (typically between 0.1 and 10.0) $outputgamma − The output gamma value (typically between 0.1 and 10.0) Return Values Returns ...

Read More
Showing 51–60 of 108 articles
« Prev 1 4 5 6 7 8 11 Next »
Advertisements