int_adapter operator-(const int_adapter& rhs) const { if (is_nan() || rhs.is_nan()) { return int_adapter<int_type>(not_a_number()); } if (is_infinity()) { return *this; } if (rhs.is_infinity()) { return rhs; } return int_adapter<int_type>(value_ - rhs.value_); }
// should templatize this to be consistant with op +- int_adapter operator%(const int_adapter& rhs)const { if(this->is_special() || rhs.is_special()) { if(is_infinity() && rhs.is_infinity()) { return int_adapter<int_type>(not_a_number()); } if(rhs != 0) { return mult_div_specials(rhs); } else { // let divide by zero blow itself up return int_adapter<int_type>(value_ % rhs.value_); } } return int_adapter<int_type>(value_ % rhs.value_); }