X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fmath%2Fabs.c;h=bba8e7e718d1027bc4f2c15c7b7ea89dde461bd0;hb=e5456e3c2697c4e17fc9aa3439f2e305517b4d96;hp=1cd660dce46225a67b2195d38980a116c2d1435b;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/math/abs.c b/functions/math/abs.c index 1cd660d..bba8e7e 100644 --- a/functions/math/abs.c +++ b/functions/math/abs.c @@ -21,6 +21,23 @@ long long abs( long long i ) { /* TODO */ }; // Standard C double fabs( double x ) { /* TODO */ }; + +/* Therx code +{ + return ( x < 0 ) ? -x : x; +} +*/ + +/* PDPC code - unreviewed +{ + if (x < 0.0) + { + x = -x; + } + return (x); +} +*/ + float fabsf( float x ) { /* TODO */ }; long double fabsl( long double x ) { /* TODO */ };