From 824a2d9f587ca017fc71b84d835e72f54f9c87c4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Nov 2018 18:02:36 +0100 Subject: Began rewrite --- node_modules/locutus/php/math/abs.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 node_modules/locutus/php/math/abs.js (limited to 'node_modules/locutus/php/math/abs.js') diff --git a/node_modules/locutus/php/math/abs.js b/node_modules/locutus/php/math/abs.js new file mode 100644 index 0000000..7be6a86 --- /dev/null +++ b/node_modules/locutus/php/math/abs.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = function abs(mixedNumber) { + // discuss at: http://locutus.io/php/abs/ + // original by: Waldo Malqui Silva (http://waldo.malqui.info) + // improved by: Karol Kowalski + // improved by: Kevin van Zonneveld (http://kvz.io) + // improved by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) + // example 1: abs(4.2) + // returns 1: 4.2 + // example 2: abs(-4.2) + // returns 2: 4.2 + // example 3: abs(-5) + // returns 3: 5 + // example 4: abs('_argos') + // returns 4: 0 + + return Math.abs(mixedNumber) || 0; +}; +//# sourceMappingURL=abs.js.map \ No newline at end of file -- cgit v1.2.3