locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
16 lines (15 loc) • 592 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.neg = neg;
const _operator_ts_1 = require("../_helpers/_operator.js");
function neg(a) {
// discuss at: https://locutus.io/python/operator/neg/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Returns the Python-style unary negative of a numeric value.
// example 1: neg(4)
// returns 1: -4
// example 2: neg(true)
// returns 2: -1
return (0, _operator_ts_1.pythonNeg)(a, 'neg');
}