Doxygen Source Code Documentation
d_mod.c File Reference
#include "f2c.h"
#include "mathh.h"
Go to the source code of this file.
Functions | |
double | d_mod (doublereal *x, doublereal *y) |
Function Documentation
|
Definition at line 17 of file d_mod.c.
00019 { 00020 #ifdef IEEE_drem 00021 double xa, ya, z; 00022 if ((ya = *y) < 0.) 00023 ya = -ya; 00024 z = drem(xa = *x, ya); 00025 if (xa > 0) { 00026 if (z < 0) 00027 z += ya; 00028 } 00029 else if (z > 0) 00030 z -= ya; 00031 return z; 00032 #else 00033 double quotient; 00034 if( (quotient = *x / *y) >= 0) 00035 quotient = floor(quotient); 00036 else 00037 quotient = -floor(-quotient); 00038 return(*x - (*y) * quotient ); 00039 #endif 00040 } |