Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 1117 of 3363
848 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 it gives the subtraction of the two numbers after scaling the result to an identified precision.Syntaxstring bcsub ($num_str1, $num_str2, $scaleVal)ParametersThe 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.$num_str2 − It represents the right operand and it is the string type parameter.$scaleVal − It is the optional integer type parameter that is used to set the number of digits after ... Read More
1K+ Views
In PHP, bccomp() function is used to compare two arbitrary numbers. The bccomp() function takes two arbitrary precision numbers as strings and gives the output as an integer after comparing the two numbers.Syntaxint bccomp($left_string1, $right_string1, $scaleval)ParametersThe bccomp() function accepts three different parameters− $left_string1, $right_string2 and $scaleval.$left_string1− It represents the left operand of one of two given numbers which we want to do the comparison and it is a string type parameter.$right_string2− It represents the right operand of one of two given numbers which we want to do the comparison and it is a string type parameter.$scaleval− It returns the number ... Read More
807 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 it gives the result as a division of two numbers after scaling the result to an identified precision. Or, we can say that the bcdiv() PHP function divides the dividend by the divisor.Syntaxstring bcdiv($num_string1, $num_string2, $scaleVal)ParametersThe bcmul() math function accepts three different parameters $num_string1, $num_string2 and $scaleVal.$num_string1 − It represents the dividend and it is the string type parameter.$num_string2 − It represents the divisor, it is the string type parameter.$scaleVal − It is the optional ... Read More
334 Views
In PHP, bcmod() math function is used to calculate the modulus of an arbitrary precision number. The bcmod() function takes an arbitrary precision number as strings and it gives the result as a modulus of numbers after scaling the result to an identified precision. Or, we can say that it gets the remainder after dividing string_num1 by string_num2. Unless the string_num2 is 0, the result has the same sign as string_num1.Syntaxbcmod(string_$num1, string_$num2, [, int $scale=0])Or, bcmod(string $dividend, string $divisor[, int $scale=0])Note− The above syntax will get the remainder of dividing $string_num1 by $string_num2. Unless string_num2 is 0, the result has ... Read More
1K+ Views
In PHP, bcmul() math function is used to multiply one arbitrary precision number with another number. The bcmul() function takes two arbitrary precision numbers as strings and it gives the result as the multiplication of two numbers after scaling the result to an identified precision.Syntaxstring bcmul( $num_string1, $num_string2, $scaleVal)ParametersThe bcmul() math function accepts three different parameters $num_string1, $num_string2 and $scaleVal.$num_string1 - It represents the left operand and it is the string type parameter.$num_string2 - It represents the right operand, it is the string type parameter.$scaleVal - This is the optional integer type parameter that is used to set the number of digits ... Read More
223 Views
In PHP, bcpow() function is used to raise an arbitrary precision base number to another exponent number. It takes two arbitrary precision numbers as strings and gives the base number raised to the power exponent after scaling the result to the listed precision.SyntaxString bcpow($base, $exponent, $scale)ParametersThe bcpow() function in PHP takes three different parameters: $base, $exponent and $scale.$base - It represents the base in which power will be raised and it is the string type parameter.$exponent - It represents the exponent and it is the string type parameter.$scale - It indicates the number of digits that appear after the decimal in ... Read More
471 Views
In PHP, bcadd() math function is used to add two arbitrary precision numbers. The bcadd() function takes two random precision numbers as strings and it returns the addition of the two numbers after scaling the result to an identified precision.Syntaxstring bcadd ( $num_str1, $num_str2, $scaleVal)ParametersThe bcadd() 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.$num_str2 - It represents the right operand and it is the string type parameter.$scaleVal - It is the optional parameter that is used to set the number of digits after the decimal place in the ... Read More
4K+ Views
Data chunks in Node.js or any other language can be defined as a fragment of data that is sent to all the servers by the client. The servers make a stream of these chunks and form a buffer stream. This buffer stream is then converted into meaningful data.Syntaxrequest.on('eventName', [callback] )ParametersThe parameters are described below −eventName − It is the name of the event that will be fired.callback − Callback function to handle any error if it occurs.ExampleCreate a file with the name "index.js" and copy the following code snippet. After creating the file, use the command "node index.js" to run ... Read More
744 Views
The main aim of a Node.js application is to work as a backend technology and serve requests and return response. But we can also pass inputs directly to a Node.js application.We can use readline-sync, a third-party module to accept user inputs in a synchronous manner.Syntaxnpm install readline-syncThis will install the readline-sync module dependency in your local npm project.Example 1Create a file with the name "input.js" and copy the following code snippet. After creating the file, use the command "node input.js" to run this code.//Giving Input to a Node.js application Demo Example // Importing the realine-sync module const readline = ... Read More
240 Views
The util.debuglog() method creates a function that can be used to write the desired error/debug messages to stderr. These error messages are written only upon the existence of the NODE_DEBUG environment variable.Syntaxutil.debuglog(section, [callback])ParametersThe parameters are described below −section − This parameter takes the portion of the application for which the debug log is being created.callback − This is the callback function which will receive the pointer if any error occurs during the execution of method.Example 1Create a file with the name "debuglog.js" and copy the following code snippet - Live Demo// util.debuglog() demo example // Importing the util module const ... Read More