project-1a-maths

Simple Math Project for npm

Usage no npm install needed!

<script type="module">
  import project1aMaths from 'https://cdn.skypack.dev/project-1a-maths';
</script>

README

Math Operations

Module to do simple math operations

Installation

Follow this instructions

npm install project-1a-maths

Use

Follow this instructions

// Import the module
const mathModule = require('.');

// Sums
console.log(mathModule.sum(1, 2)); // Expects: 3

console.log(mathModule.sum(1, 34)); // Expects: 35

// Substracts
console.log(mathModule.substract(11, 24)); // Expects: -13

console.log(mathModule.substract(1, 2)); // Expects: -1

// Multiplication
console.log(mathModule.multiply(11, 24)); // Expects: 24

console.log(mathModule.multiply(1, 2)); // Expects: 2

// Division
console.log(mathModule.multiply(1, 4)); // Expects: 0.25

console.log(mathModule.multiply(1, 2)); // Expects: 0.5