Skip to content

Commit

Permalink
more math lib
Browse files Browse the repository at this point in the history
  • Loading branch information
omyyys committed Jul 25, 2022
1 parent 7a04066 commit f28b4f6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
31 changes: 31 additions & 0 deletions headers/pymath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,37 @@ class Math{
return tanf(x);
}

long double acos(long double x){
return acosf(x);
}

long double asin(long double x){
return asinf(x);
}

long double atan(long double x){
return atanf(x);
}

long double hcos(long double x){
return acosf(x);
}

long double hsin(long double x){
return asinf(x);
}

long double htan(long double x){
return atanf(x);
}

long double radians(long double deg){
return deg * (pi / 180);
}

long double degrees(long double rad){
return rad * (180 / pi);
}

int floor(long double x){
return floorf(x);
Expand Down
3 changes: 3 additions & 0 deletions refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def refactorforcompiler(code: list):
if '"' not in str(lineandindlevel[i][0]).strip() and "." in str(lineandindlevel[i][0]).strip():
lineandindlevel[i] = (str(lineandindlevel[i][0]).strip().split("=", 1)[0] + ":floatlist = " + str(lineandindlevel[i][0]).strip().split("=", 1)[1], lineandindlevel[i][1])

else:
lineandindlevel[i] = (str(lineandindlevel[i][0]).strip().split("=", 1)[0] + ":list = " + str(lineandindlevel[i][0]).strip().split("=", 1)[1], lineandindlevel[i][1])

if not definanylines:
lineandindlevel[-1] = (lineandindlevel[-1][0] + ";", lineandindlevel[-1][1])

Expand Down
2 changes: 1 addition & 1 deletion source.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hello = [3.4]
"Hello"

0 comments on commit f28b4f6

Please sign in to comment.