Skip to content

Commit cf40faa

Browse files
committed
Добавлены функции в модуль math
1 parent d3f5212 commit cf40faa

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

src/com/annimon/ownlang/lib/modules/math.java

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,41 @@ public final class math implements Module {
1616
@Override
1717
public void init() {
1818
Functions.set("abs", functionConvert(Math::abs));
19+
Functions.set("acos", functionConvert(Math::acos));
20+
Functions.set("asin", functionConvert(Math::asin));
21+
Functions.set("atan", functionConvert(Math::atan));
22+
Functions.set("atan2", biFunctionConvert(Math::atan2));
23+
Functions.set("cbrt", functionConvert(Math::cbrt));
24+
Functions.set("ceil", functionConvert(Math::ceil));
25+
Functions.set("copySign", biFunctionConvert(Math::copySign));
1926
Functions.set("cos", functionConvert(Math::cos));
27+
Functions.set("cosh", functionConvert(Math::cosh));
28+
Functions.set("exp", functionConvert(Math::exp));
29+
Functions.set("expm1", functionConvert(Math::expm1));
30+
Functions.set("floor", functionConvert(Math::floor));
31+
Functions.set("getExponent", functionConvert(Math::getExponent));
32+
Functions.set("hypot", biFunctionConvert(Math::hypot));
33+
Functions.set("IEEEremainder", biFunctionConvert(Math::IEEEremainder));
34+
Functions.set("log", functionConvert(Math::log));
35+
Functions.set("log1p", functionConvert(Math::log1p));
36+
Functions.set("log10", functionConvert(Math::log10));
37+
Functions.set("max", biFunctionConvert(Math::max));
38+
Functions.set("min", biFunctionConvert(Math::min));
39+
Functions.set("nextAfter", biFunctionConvert(Math::nextAfter));
40+
Functions.set("nextUp", functionConvert(Math::nextUp));
41+
Functions.set("pow", biFunctionConvert(Math::pow));
42+
Functions.set("rint", functionConvert(Math::rint));
43+
Functions.set("round", functionConvert(Math::round));
44+
Functions.set("signum", functionConvert(Math::signum));
2045
Functions.set("sin", functionConvert(Math::sin));
46+
Functions.set("sinh", functionConvert(Math::sinh));
2147
Functions.set("sqrt", functionConvert(Math::sqrt));
48+
Functions.set("tan", functionConvert(Math::tan));
49+
Functions.set("tanh", functionConvert(Math::tanh));
2250
Functions.set("toDegrees", functionConvert(Math::toDegrees));
2351
Functions.set("toRadians", functionConvert(Math::toRadians));
24-
25-
Functions.set("pow", biFunctionConvert(Math::pow));
26-
Functions.set("atan2", biFunctionConvert(Math::atan2));
27-
52+
Functions.set("ulp", functionConvert(Math::ulp));
53+
2854
Variables.set("PI", new NumberValue(Math.PI));
2955
Variables.set("E", new NumberValue(Math.E));
3056
}

0 commit comments

Comments
 (0)