Skip to content

Commit

Permalink
Primera version del modulo de matematicas basica OK
Browse files Browse the repository at this point in the history
  • Loading branch information
mugan86 committed Mar 2, 2019
1 parent 8dd00f0 commit a9af48b
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
43 changes: 43 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
/**
* Suma de dos numeros
* @example
* n1 = 1 , n2 = 3 = > resultado 4
* @param {*} n1 Numero uno de la suma
* @param {*} n2 Numero dos de la suma
*/
suma: function (n1, n2) {
return n1 + n2;
},
/**
* Resta de dos numeros
* @example
* n1 = 1 , n2 = 3 = > resultado -2
* @param {*} n1 Numero uno de la resta
* @param {*} n2 Numero dos de la resta
*/
resta: function (n1, n2) {
return n1 - n2;
},
/**
* Multiplicacion de dos numeros
* @example
* n1 = 1 , n2 = 3 = > resultado 3
* @param {*} n1 Numero uno de la multiplicacion
* @param {*} n2 Numero dos de la multiplicacion
*/
multiplicacion: function (n1, n2) {
return n1 * n2;
},
/**
* Division de dos numeros
* @example
* n1 = 1 , n2 = 3 = > resultado 0.33
* @param {*} n1 Numero uno de la Division
* @param {*} n2 Numero dos de la Division
*/
division: function (n1, n2) {
return n1 / n2;
}
}

28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "proyecto-1a-matematicas",
"version": "1.0.0",
"description": "Proyecto de matemáticas sencillo para aprender NodeJS y subirlo a NPM",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm-js-ts-angular-modules-course/proyecto-1a-matematicas.git"
},
"keywords": [
"math",
"matematica",
"suma",
"resta",
"division",
"multi",
"basico"
],
"author": "Anartz Mugika <mugan86@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/npm-js-ts-angular-modules-course/proyecto-1a-matematicas/issues"
},
"homepage": "https://github.com/npm-js-ts-angular-modules-course/proyecto-1a-matematicas#readme"
}
10 changes: 10 additions & 0 deletions pruebas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const m = require('.');

console.log(m.suma(1,2));

console.log(m.suma(1,2));

console.log(m.resta(11,24));
console.log(m.resta(1,2));
console.log(m.multiplicacion(1,24));
console.log(m.multiplicacion(1,2));

0 comments on commit a9af48b

Please sign in to comment.