Changeset 7d7bc09 in mainline for uspace/lib/posix/src


Ignore:
Timestamp:
2018-06-20T18:58:11Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
777832e
Parents:
3bd1d7d4
Message:

abs, labs, llabs.

Location:
uspace/lib/posix/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/stdlib.c

    r3bd1d7d4 r7d7bc09  
    4949#include "libc/vfs/vfs.h"
    5050#include "libc/stats.h"
    51 
    52 /**
    53  * Integer absolute value.
    54  *
    55  * @param i Input value.
    56  * @return Absolute value of the parameter.
    57  */
    58 int abs(int i)
    59 {
    60         return i < 0 ? -i : i;
    61 }
    62 
    63 /**
    64  * Long integer absolute value.
    65  *
    66  * @param i Input value.
    67  * @return Absolute value of the parameter.
    68  */
    69 long labs(long i)
    70 {
    71         return i < 0 ? -i : i;
    72 }
    73 
    74 /**
    75  * Long long integer absolute value.
    76  *
    77  * @param i Input value.
    78  * @return Absolute value of the parameter.
    79  */
    80 long long llabs(long long i)
    81 {
    82         return i < 0 ? -i : i;
    83 }
    8451
    8552/**
  • uspace/lib/posix/src/stdlib/strtold.c

    r3bd1d7d4 r7d7bc09  
    5252#ifndef HUGE_VALL
    5353#define HUGE_VALL (+1.0l / +0.0l)
    54 #endif
    55 
    56 #ifndef abs
    57 #define abs(x) (((x) < 0) ? -(x) : (x))
    5854#endif
    5955
Note: See TracChangeset for help on using the changeset viewer.