var assert = require("assert");
var inttypes = require("./inttypes");

module.exports = {
	endAroundCarry16: function (value) {
		assert(inttypes.isInt32(value));
		value += value >>> 16;
		return ~value & 0xFFFF;
	}
};
