Coder Social home page Coder Social logo

rr69sport / basic_maths Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 117 KB

Basic math operations. Add, substract, multiply and divide.

Home Page: https://www.npmjs.com/package/basic-maths

License: MIT License

TypeScript 100.00%
math add multiply substraction maths javascript

basic_maths's Introduction

Basic math methods

How to install

npm install basic-maths

How to use

// with require
const { basicMaths } = require("basic-maths");

// with import
import { basicMaths } from 'basic-maths';
// methods
const add = basicMaths.add(1, 3); // return 4

const substract = basicMaths.substract(1, 2); // return -1

const multiply = basicMaths.multiply(1, 2); // return 2

const divideGood = basicMaths.divide(1, 2); // Good - return 0.5

const divideBad = basicMaths.divide(1, 0); // Bad - No number is divisible by zero

const powOperation = basicMaths.powOperation(2, 2); // return 8

CNDs

If your application is not from Node and you still want to use it on the frontend, you can import the CDN that is hosted on jsDelivr

How to import

Just copy and paste in your html this script

<script src="https://cdn.jsdelivr.net/npm/[email protected]/build-browser/index.min.js"></script>

Stats

GitHub Actions

NPM Publish Publish new release

GitHub Stats

GitHub forks GitHub stars GitHub issues GitHub last commit NPM License GitHub code size in kB GitHub contributors

NPM Stats

NPM version NPM downloads npm collaborators

jsDelivr monthly hits

jsDelivr

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.