Skip to content

Commit

Permalink
y-script: Added sqrt function
Browse files Browse the repository at this point in the history
  • Loading branch information
Yankes committed Nov 4, 2023
1 parent 2424e76 commit 63df39e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Engine/Script.cpp
Expand Up @@ -213,6 +213,7 @@ static inline RetEnum bit_popcount_h(int& reg)
IMPL(bit_count, MACRO_QUOTE({ return bit_popcount_h(Reg0); }), (int& Reg0), "Count number of set bits of arg1") \
\
IMPL(pow, MACRO_QUOTE({ Reg0 = std::pow(Reg0, std::max(0, Data1)); return RetContinue; }), (int& Reg0, int Data1), "Power of arg1 to arg2") \
IMPL(sqrt, MACRO_QUOTE({ Reg0 = Reg0 > 0 ? std::sqrt(Reg0) : 0; return RetContinue; }), (int& Reg0), "Square root of arg1") \
\
IMPL(abs, MACRO_QUOTE({ Reg0 = std::abs(Reg0); return RetContinue; }), (int& Reg0), "Absolute value of arg1") \
IMPL(limit, MACRO_QUOTE({ Reg0 = std::max(std::min(Reg0, Data2), Data1); return RetContinue; }), (int& Reg0, int Data1, int Data2), "Correct value in arg1 that is always between arg2 and arg3") \
Expand Down

0 comments on commit 63df39e

Please sign in to comment.