#ifndef __NUMBERS_RATIO_H #define __NUMBERS_RATIO_H #include "Values/Values" #include <5D/Operations> namespace Numbers { struct Ratio : Values::Node { Values::NodeT a; /* numerator */ Values::NodeT b; /* denominator */ }; Ratio* makeRatio(Values::NodeT aa, Values::NodeT bb); bool ratio_P(Values::NodeT n); inline Values::NodeT Ratio_getA(Values::NodeT n) { return(((Ratio*)n)->a); } inline Values::NodeT Ratio_getB(Values::NodeT n) { return(((Ratio*)n)->b); } DECLARE_SIMPLE_OPERATION(RatioMaker) DECLARE_SIMPLE_OPERATION(RatioP) DECLARE_SIMPLE_OPERATION(RatioNumeratorGetter) DECLARE_SIMPLE_OPERATION(RatioDenominatorGetter) }; #endif /* ndef __NUMBERS_RATIO_H */