git.iko.soy/rowtype-yoga/yoga-r3f
on main help sign in
26 lines 580 B history raw
1export const intDegree = function (x) {
2 return Math.min(Math.abs(x), 2147483647);
3};
5// See the Euclidean definition in
6// https://en.m.wikipedia.org/wiki/Modulo_operation.
7export const intDiv = function (x) {
8 return function (y) {
9 if (y === 0) return 0;
10 return y > 0 ? Math.floor(x / y) : -Math.floor(x / -y);
11 };
12};
14export const intMod = function (x) {
15 return function (y) {
16 if (y === 0) return 0;
17 var yy = Math.abs(y);
18 return ((x % yy) + yy) % yy;
19 };
20};
22export const numDiv = function (n1) {
23 return function (n2) {
24 return n1 / n2;
25 };
26};