diff options
| author | Thomas Perl <m@thp.io> | 2020-02-24 19:43:18 +0100 |
|---|---|---|
| committer | Thomas Perl <m@thp.io> | 2020-02-24 19:43:18 +0100 |
| commit | 3fa22fad0dcd4bd8520c931199d39784024e1e01 (patch) | |
| tree | 4ad9c2a29b822c3822282cbfbe078b81e53d1792 | |
| parent | d02f96e4abcc60b9eb5b8c318a1dd3fe5a5a80b7 (diff) | |
| download | psn00bsdk-3fa22fad0dcd4bd8520c931199d39784024e1e01.tar.gz | |
libc: Add abs() and labs() functions
| -rw-r--r-- | libpsn00b/libc/abs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpsn00b/libc/abs.c b/libpsn00b/libc/abs.c new file mode 100644 index 0000000..a972cad --- /dev/null +++ b/libpsn00b/libc/abs.c @@ -0,0 +1,7 @@ +int abs(int i) { + return (i < 0) ? (-i) : i; +} + +long labs(long i) { + return (i < 0) ? (-i) : i; +} |
