X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fmath%2Fmod.c;h=ed3a371ee65ac84961a2cf08a7247793a54ebbe8;hb=e081ed1387e0c27dc689c8e32fdda06039544107;hp=9e002cf4dfc98891ca9f734ff8a92c32eec30824;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec;p=pdclib diff --git a/functions/math/mod.c b/functions/math/mod.c index 9e002cf..ed3a371 100644 --- a/functions/math/mod.c +++ b/functions/math/mod.c @@ -5,19 +5,20 @@ // This code is Public Domain. Use, modify, and redistribute at will. // ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- -// C++ +double fmod( double x, double y ) { /* TODO */ }; -float fmod( float x, float y ) { /* TODO */ }; -long double fmod( long double x, long double y ) { /* TODO */ }; +/* Therx code +{ + return (int) ( ( ( ( x / y ) - ( (int) ( x / y ) ) ) * y ) + 0.5 ); +} +*/ -float modf( float x, float * integer ) { /* TODO */ }; -long double modf( long double x, long double * integer ) { /* TODO */ }; +/* PDPC code - unreviewed +{ + return (x / y); +} +*/ -// ---------------------------------------------------------------------------- -// Standard C - -double fmod( double x, double y ) { /* TODO */ }; float fmodf( float x, float y ) { /* TODO */ }; long double fmodl( long double x, long double y ) { /* TODO */ };