X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fmath%2Fabs.c;h=bba8e7e718d1027bc4f2c15c7b7ea89dde461bd0;hp=1cd660dce46225a67b2195d38980a116c2d1435b;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec 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 */ };