locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
16 lines (15 loc) • 472 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cbrt = cbrt;
function cbrt(x) {
// discuss at: https://locutus.io/ruby/Math/cbrt/
// parity verified: Ruby 3.3
// original by: Kevin van Zonneveld (https://kvz.io)
// example 1: cbrt(8)
// returns 1: 2
// example 2: cbrt(27)
// returns 2: 3
// example 3: cbrt(1)
// returns 3: 1
return Math.cbrt(x);
}