time-to-botec/squiggle/node_modules/@rescript/std/lib/es6/js_math.js

51 lines
766 B
JavaScript
Raw Normal View History

import * as Js_int from "./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;
export {
unsafe_ceil ,
ceil_int ,
ceil ,
unsafe_floor ,
floor_int ,
floor ,
random_int ,
}
/* No side effect */