コード例 #1
0
ファイル: int_adapter.hpp プロジェクト: 2asoft/xray-16
 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_);
 }
コード例 #2
0
ファイル: int_adapter.hpp プロジェクト: Kaoschuks/cppcms
 // 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_);
 }