BC Math Binary Calculator

suggest change

Introduction

The Binary Calculator can be used to calculate with numbers of any size and precision up to 2147483647-1 decimals, in string format. The Binary Calculator is more precise than the float calculation of PHP.

Syntax

Parameters

bcadd | Add two arbitrary precision numbers. | — | — |left_operand | The left operand, as a string. |right_operand | The right operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |bccomp | Compare two arbitrary precision numbers. |left_operand | The left operand, as a string. |right_operand | The right operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place which will be used in the comparison.|bcdiv | Divide two arbitrary precision numbers. |left_operand | The left operand, as a string. |right_operand | The right operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |bcmod | Get modulus of an arbitrary precision number. |left_operand | The left operand, as a string. |modulus | The modulus, as a string. |bcmul | Multiply two arbitrary precision numbers. |left_operand | The left operand, as a string. |right_operand | The right operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |bcpow | Raise an arbitrary precision number to another. |left_operand | The left operand, as a string. |right_operand | The right operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |bcpowmod | Raise an arbitrary precision number to another, reduced by a specified modulus. |left_operand | The left operand, as a string. |right_operand | The right operand, as a string. |modulus | The modulus, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |bcscale | Set default scale parameter for all bc math functions. |scale | The scale factor. |bcsqrt | Get the square root of an arbitrary precision number. |operand | The operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |bcsub | Subtract one arbitrary precision number from another. |left_operand | The left operand, as a string.|right_operand |The right operand, as a string. |scale | A optional parameter to set the number of digits after the decimal place in the result. |

Remarks

For all BC functions, if the scale parameter is not set, it defaults to 0, which will make all operations integer operations.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents