瀏覽代碼

Implemented llabs() in stdlib.h/cpp.

Holden Green 4 年之前
父節點
當前提交
18a641f3f8
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 5 0
      Userland/Libraries/LibC/stdlib.cpp
  2. 1 0
      Userland/Libraries/LibC/stdlib.h

+ 5 - 0
Userland/Libraries/LibC/stdlib.cpp

@@ -713,6 +713,11 @@ int abs(int i)
     return i < 0 ? -i : i;
 }
 
+long long int llabs(long long int i)
+{
+    return i < 0 ? -i : i;
+}
+
 long int random()
 {
     return rand();

+ 1 - 0
Userland/Libraries/LibC/stdlib.h

@@ -49,6 +49,7 @@ char* ptsname(int fd);
 int ptsname_r(int fd, char* buffer, size_t);
 int abs(int);
 long labs(long);
+long long int llabs(long long int);
 double atof(const char*);
 int system(const char* command);
 char* mktemp(char*);