Use this tool class when advanced mathematical functions are required.

import crafttweaker.util.Math;

Available methods

Link to available-methods

ZenScript
Copy
Math.max(double d1, double d2);
Math.max(float f1, float f2);
Math.max(int i1, int i2);

Math.min(double d1, double d2);
Math.min(float f1, float f2);
Math.min(int i1, int i2);

Math.floor(double d1);
Math.ceil(double d1);

Math.abs(double d1);
Math.abs(float f1);
Math.abs(int i1);

Math.sin(double d1);
Math.cos(double d1);
Math.tan(double d1);
Math.asin(double d1);
Math.acos(double d1);
Math.atan(double d1);
Math.sinh(double d1);
Math.cosh(double d1);
Math.tanh(double d1);

Math.sqrt(double d1);
Math.round(float f1);
Math.round(double d1);

Math.clamp(double value, double min, double max);
Math.clamp(float value, float min, float max);
Math.clamp(int value, int min, int max);

Math.log(double input);
Math.log10(double input);