avocado-old/packages/math/math.js
2019-11-03 10:40:08 -06:00

53 lines
1.6 KiB
JavaScript

export const abs = Math.abs;
export const acos = Math.acos;
export const acosh = Math.acosh;
export const asin = Math.asin;
export const asinh = Math.asinh;
export const atan = Math.atan;
export const atanh = Math.atanh;
export const atan2 = Math.atan2;
export const ceil = Math.ceil;
export const cbrt = Math.cbrt;
export const expm1 = Math.expm1;
export const clz32 = Math.clz32;
export const cos = Math.cos;
export const cosh = Math.cosh;
export const exp = Math.exp;
export const floor = Math.floor;
export const fround = Math.fround;
export const hypot = Math.hypot;
export const imul = Math.imul;
export const log = Math.log;
export const log1p = Math.log1p;
export const log2 = Math.log2;
export const log10 = Math.log10;
export const max = Math.max;
export const min = Math.min;
export const pow = Math.pow;
export const random = Math.random;
export const round = Math.round;
export const sign = Math.sign;
export const sin = Math.sin;
export const sinh = Math.sinh;
export const sqrt = Math.sqrt;
export const tan = Math.tan;
export const tanh = Math.tanh;
export const trunc = Math.trunc;
export const E = Math.E;
export const LN10 = Math.LN10;
export const LN2 = Math.LN2;
export const LOG10E = Math.LOG10E;
export const LOG2E = Math.LOG2E;
export const PI = Math.PI;
export const SQRT1_2 = Math.SQRT1_2;
export const SQRT2 = Math.SQRT2;
export const add = (l, r) => l + r;
export const div = (l, r) => l / r;
export const frac = (number) => number % 1;
export const mul = (l, r) => l * r;
export const randomNumber = (min, max) => {
return min + Math.random() * (max - min);
};
export const sub = (l, r) => l - r;