Git Product home page Git Product logo

kashyapkaki / safe-math Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9 KB

SafeMath is a utility library for performing safe arithmetic operations in JavaScript. It ensures that the results of arithmetic operations do not exceed the safe integer range in JavaScript.

Home Page: https://www.npmjs.com/package/safe-math-operations

License: MIT License

JavaScript 100.00%
arthemetic javascript math mathematics operations safe

safe-math's Introduction

Safe Math Operations

SafeMath is a utility library for performing safe arithmetic operations in JavaScript. It ensures that the results of arithmetic operations do not exceed the safe integer range in JavaScript (Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER).

Installation

npm i safe-math-operations

Usage Here is an example of how to use the SafeMath library:

const SafeMath = require('safe-math-operations');

console.log(SafeMath.add(1, 2)); // 3
console.log(SafeMath.subtract(5, 3)); // 2
console.log(SafeMath.multiply(2, 3)); // 6
console.log(SafeMath.divide(6, 2)); // 3

Contributing

If you would like to contribute to the SafeMath library, please follow these steps:

  • Fork the repository.
  • Create a new branch (git checkout -b feature/your-feature).
  • Commit your changes (git commit -m 'Add some feature').
  • Push to the branch (git push origin feature/your-feature).
  • Create a new Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

safe-math's People

Contributors

kashyapkaki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.