mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
includes/std: Added extra math functions
This commit is contained in:
@@ -20,13 +20,13 @@ namespace std::math {
|
||||
};
|
||||
|
||||
fn sign(auto x) {
|
||||
if (x > 0)
|
||||
return 1;
|
||||
else if (x < 0)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
};
|
||||
if (x > 0)
|
||||
return 1;
|
||||
else if (x < 0)
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
};
|
||||
|
||||
fn copy_sign(auto x, auto y) {
|
||||
if (y >= 0)
|
||||
@@ -61,4 +61,36 @@ namespace std::math {
|
||||
return std::math::factorial(n) / std::math::factorial(n - k);
|
||||
};
|
||||
|
||||
|
||||
fn floor(auto value) { return builtin::std::math::floor(value); };
|
||||
fn ceil(auto value) { return builtin::std::math::ceil(value); };
|
||||
fn round(auto value) { return builtin::std::math::round(value); };
|
||||
fn trunc(auto value) { return builtin::std::math::trunc(value); };
|
||||
|
||||
fn log10(auto value) { return builtin::std::math::log10(value); };
|
||||
fn log2(auto value) { return builtin::std::math::log2(value); };
|
||||
fn ln(auto value) { return builtin::std::math::ln(value); };
|
||||
|
||||
fn fmod(auto value) { return builtin::std::math::fmod(value); };
|
||||
fn pow(auto base, auto exp) { return builtin::std::math::pow(base, exp); };
|
||||
fn sqrt(auto value) { return builtin::std::math::sqrt(value); };
|
||||
fn cbrt(auto value) { return builtin::std::math::cbrt(value); };
|
||||
|
||||
fn sin(auto value) { return builtin::std::math::sin(value); };
|
||||
fn cos(auto value) { return builtin::std::math::cos(value); };
|
||||
fn tan(auto value) { return builtin::std::math::tan(value); };
|
||||
|
||||
fn asin(auto value) { return builtin::std::math::asin(value); };
|
||||
fn acos(auto value) { return builtin::std::math::acos(value); };
|
||||
fn atan(auto value) { return builtin::std::math::atan(value); };
|
||||
fn atan2(auto value) { return builtin::std::math::atan2(value); };
|
||||
|
||||
fn sinh(auto value) { return builtin::std::math::sinh(value); };
|
||||
fn cosh(auto value) { return builtin::std::math::cosh(value); };
|
||||
fn tanh(auto value) { return builtin::std::math::tanh(value); };
|
||||
|
||||
fn asinh(auto value) { return builtin::std::math::asinh(value); };
|
||||
fn acosh(auto value) { return builtin::std::math::acosh(value); };
|
||||
fn atanh(auto value) { return builtin::std::math::atanh(value); };
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user