29 lines
365 B
JavaScript
29 lines
365 B
JavaScript
|
|
|
|
|
|
function div(x, y) {
|
|
if (y === 0) {
|
|
throw {
|
|
RE_EXN_ID: "Division_by_zero",
|
|
Error: new Error()
|
|
};
|
|
}
|
|
return x / y | 0;
|
|
}
|
|
|
|
function mod_(x, y) {
|
|
if (y === 0) {
|
|
throw {
|
|
RE_EXN_ID: "Division_by_zero",
|
|
Error: new Error()
|
|
};
|
|
}
|
|
return x % y;
|
|
}
|
|
|
|
export {
|
|
div ,
|
|
mod_ ,
|
|
}
|
|
/* No side effect */
|