1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
////////////////////////////////////////////////////////////////////////////////
//
// Field.hh
//
// produced: 21/08/97 jr
// last change: 30/10/97 jr
//
////////////////////////////////////////////////////////////////////////////////
#ifndef FIELD_HH
#define FIELD_HH
#include <Rational.h>
typedef Rational Field;
static const Field ZERO = Field(0);
static const Field ONE = Field(1);
static const Field MINUSONE = Field(-1);
inline const int sign(const Field& f) {
if (f == ZERO) {
return 0;
}
else if (f > ZERO) {
return 1;
}
else {
return -1;
}
}
#endif
// eof Field.hh
|