@rescript/std
Version:
The motiviation of this repo is that when ReScript users want to share their library with JS users, the JS users don't need have ReScript toolchain installed, this makes sharing code with JS users easier (more details on that topic can be found in our [Ex
49 lines (39 loc) • 881 B
JavaScript
;
var Js_int = require("./js_int.js");
function unsafe_ceil(prim) {
return Math.ceil(prim);
}
function ceil_int(f) {
if (f > Js_int.max) {
return Js_int.max;
} else if (f < Js_int.min) {
return Js_int.min;
} else {
return Math.ceil(f);
}
}
function unsafe_floor(prim) {
return Math.floor(prim);
}
function floor_int(f) {
if (f > Js_int.max) {
return Js_int.max;
} else if (f < Js_int.min) {
return Js_int.min;
} else {
return Math.floor(f);
}
}
function random_int(min, max) {
return floor_int(Math.random() * (max - min | 0)) + min | 0;
}
var ceil = ceil_int;
var floor = floor_int;
exports.unsafe_ceil = unsafe_ceil;
exports.ceil_int = ceil_int;
exports.ceil = ceil;
exports.unsafe_floor = unsafe_floor;
exports.floor_int = floor_int;
exports.floor = floor;
exports.random_int = random_int;
/* No side effect */