- Fixed a few problems with hklscan
- Added transfer of zipped data to conman.c, histogram memory software in order to support the TRICS status display. - Upgraded TRICS data file writing. - First installment of triple axis spectrometer support: initialization of data structures and an implementation of the MAD dr(ive) command.
This commit is contained in:
46
d_mod.c
Normal file
46
d_mod.c
Normal file
@ -0,0 +1,46 @@
|
||||
#include "f2c.h"
|
||||
|
||||
#ifdef KR_headers
|
||||
#ifdef IEEE_drem
|
||||
double drem();
|
||||
#else
|
||||
double floor();
|
||||
#endif
|
||||
double d_mod(x,y) doublereal *x, *y;
|
||||
#else
|
||||
#ifdef IEEE_drem
|
||||
double drem(double, double);
|
||||
#else
|
||||
#undef abs
|
||||
#include "math.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
double d_mod(doublereal *x, doublereal *y)
|
||||
#endif
|
||||
{
|
||||
#ifdef IEEE_drem
|
||||
double xa, ya, z;
|
||||
if ((ya = *y) < 0.)
|
||||
ya = -ya;
|
||||
z = drem(xa = *x, ya);
|
||||
if (xa > 0) {
|
||||
if (z < 0)
|
||||
z += ya;
|
||||
}
|
||||
else if (z > 0)
|
||||
z -= ya;
|
||||
return z;
|
||||
#else
|
||||
double quotient;
|
||||
if( (quotient = *x / *y) >= 0)
|
||||
quotient = floor(quotient);
|
||||
else
|
||||
quotient = -floor(-quotient);
|
||||
return(*x - (*y) * quotient );
|
||||
#endif
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user