bs-platform
Version:
bucklescript compiler, ocaml standard libary by bucklescript and its required runtime support
41 lines (32 loc) • 919 B
JavaScript
;
var Caml_builtin_exceptions = require("./caml_builtin_exceptions.js");
function div(x, y) {
if (y === 0) {
throw Caml_builtin_exceptions.division_by_zero;
}
return x / y | 0;
}
function mod_(x, y) {
if (y === 0) {
throw Caml_builtin_exceptions.division_by_zero;
}
return x % y;
}
function caml_bswap16(x) {
return ((x & 255) << 8) | ((x & 65280) >>> 8);
}
function caml_int32_bswap(x) {
return ((x & 255) << 24) | ((x & 65280) << 8) | ((x & 16711680) >>> 8) | ((x & 4278190080) >>> 24);
}
var imul = ( Math.imul || function (x,y) {
y |= 0; return ((((x >> 16) * y) << 16) + (x & 0xffff) * y)|0;
}
);
var caml_nativeint_bswap = caml_int32_bswap;
exports.div = div;
exports.mod_ = mod_;
exports.caml_bswap16 = caml_bswap16;
exports.caml_int32_bswap = caml_int32_bswap;
exports.caml_nativeint_bswap = caml_nativeint_bswap;
exports.imul = imul;
/* imul Not a pure module */