Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

the-math

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

the-math

Core of TheMath Calculator

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

TheMath

Lib with function to execute operations arithmetics, and you can resolve string operation with resolve.

Installation

This is a Node.js module available through the npm registry.

Installation is done using the npm install command:

Use npm:

$ npm install the-math

Use yarn:

$ yarn add the-math

Features

  • subtract - Solve subtraction between 2 numbers.
  • Sum - Solve sum between 2 numbers.
  • divide - Solve division between 2 numbers.
  • multiply - Solve multiplication between 2 numbers.
  • resolve - Solve a string operation arithmetic.

Exemples

  1. Solve subtraction between 2 numbers.
import TheMath from 'the-math';

const result = TheMath.subtract(10, 3);
// result: 7
  1. Solve subtraction between 2 numbers.
import TheMath from 'the-math';

const result = TheMath.sum(14, 7);
// result: 21
  1. Solve division between 2 numbers.
import TheMath from 'the-math';

const result = TheMath.divide(21, 3);
// result: 3
  1. Solve multiplication between 2 numbers.
import TheMath from 'the-math';

const result = TheMath.multiply(6, 3);
// result: 18
  1. Solve a string operation arithmetic.
import TheMath from 'the-math';

const result = TheMath.resolve('12+4*3*9/2+1');
// result: 67

Calculator Exercise

Tier: 1-Beginner

Calculators are not only one of the most useful tools available, but they are also a great way to understand UI and event processing in an application. In this problem you will create a calculator that supports basic arithmetic calculations on integers.

The styling is up to you so use your imagination and get creative! You might also find it worth your time to experiment with the calculator app on your mobile device to better understand basic functionality and edge cases.

Constraints

  • You may not use the eval() function to execute calculations

FAQs

Package last updated on 16 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc