mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-28 15:57:02 -05:00
* libstd: Initial standard library work bit operations, fixed point, numeric limits and math functions * libstd: Added ctype, rustint, stdint and string library, expand bit, fxpt and math library * patterns: Drastically improve ELF pattern * patterns: Added atmosphere AFE2 * patterns: tabs -> spaces * patterns: Added archive file pattern
20 lines
295 B
Plaintext
20 lines
295 B
Plaintext
namespace std::math {
|
|
|
|
fn min(auto a, auto b) {
|
|
return a < b ? a : b;
|
|
};
|
|
|
|
fn max(auto a, auto b) {
|
|
return a > b ? a : b;
|
|
};
|
|
|
|
fn clamp(auto x, auto min, auto max) {
|
|
return (x < min) ? min : ((x > max) ? max : x);
|
|
};
|
|
|
|
fn abs(auto x) {
|
|
if (x < 0) return -x;
|
|
else return x;
|
|
};
|
|
|
|
} |