Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bical

sohailfiza13MIT1.0.0

Binary Calculator and Converter

Binary, Binary Calculator, Binary Addition, Binary Substraction, Binary Multiplication, Binary Division, Binary Converter, Binary to Decimal, Binary to Hexadecimal, Binary to Octal, Octal to Binary, Decimal to Binary, Hexadecimal to Binary

readme

bical - Binary Calculator and Converter

bical is a JavaScript library for binary calculation and conversion. It provides functions to convert binary numbers to decimal, octal, and hexadecimal, as well as perform binary arithmetic operations such as addition, subtraction, multiplication, and division.

Table of Contents

  1. Installation
  2. Usage
  3. Available Functions
  4. Contribution
  5. License

Installation

To use bical in your Node.js project, you can install it, Using npm:

  npm i bical

Usage

  const bical = require('bical');

  // Example usage
  const binaryNumberFirst = 1100.011;
  const decimalValueFirst = bical.biToDec(binaryNumberFirst);
  console.log(decimalValueFirst); // Output: 12.375

  const binaryNumberSecond = -11.01;
  const decimalNumberSecond = bical.biToDec(binaryNumberSecond);
  console.log(decimalNumberSecond); // Output: -3.25

Available Functions

Arithmetic Operations

  • add: Add two or more numbers.
    bical.add(binaryNumber1, binaryNumber2, ...);
  • sub: Subtract two or more numbers.
    bical.sub(binaryNumber1, binaryNumber2, ...);
  • mul: Multiply two or more numbers.
    bical.mul(binaryNumber1, binaryNumber2, ...);
  • div: Divide two numbers.
    bical.div(dividend, divisor);

Conversions

  • biToDec: Binary to Decimal.
    bical.biToDec(binaryNumber);
  • biToOct: Binary to Octal.
    bical.biToOct(binaryNumber);
  • biToHex: Binary to Hexadecimal.
    bical.biToHex(binaryNumber);
  • decToBi: Decimal to Binary.
    bical.decToBi(decimalNumber);
  • octToBi: Octal to Binary.
    bical.octToBi(decimalNumber);
  • hexToBi: Hexadecimal to Binary.
    bical.hexToBi(decimalNumber);

Contribution

If you encounter any issues or have suggestions for improvement, feel free to open an issue. Contributions are welcome!

License

This project is licensed under the MIT License.