X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fmath%2Fmod.c;h=ed3a371ee65ac84961a2cf08a7247793a54ebbe8;hb=30ceab9cf835d23e419201fc05a573ef5ed8830e;hp=9e002cf4dfc98891ca9f734ff8a92c32eec30824;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old 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 */ };