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