locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
13 lines (12 loc) • 523 B
JavaScript
import { pythonLShift } from "../_helpers/_operator.js";
export function lshift(a, b) {
// discuss at: https://locutus.io/python/operator/lshift/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Performs Python-style integer left shifts using bigint-backed arithmetic.
// example 1: lshift(3, 2)
// returns 1: 12
// example 2: lshift(true, 3)
// returns 2: 8
return pythonLShift(a, b, 'lshift');
}