mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
LibC: Add imaxabs
This commit is contained in:
@@ -11,6 +11,11 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
intmax_t imaxabs(intmax_t n)
|
||||
{
|
||||
return n > 0 ? n : -n;
|
||||
}
|
||||
|
||||
imaxdiv_t imaxdiv(intmax_t numerator, intmax_t denominator)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
@@ -191,6 +191,8 @@ __BEGIN_DECLS
|
||||
#define SCNxFAST32 SCNx32
|
||||
#define SCNxFAST64 SCNx64
|
||||
|
||||
intmax_t imaxabs(intmax_t);
|
||||
|
||||
typedef struct imaxdiv_t {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
|
||||
Reference in New Issue
Block a user