Changeset 636
- Timestamp:
- 12/03/16 01:52:05 (8 years ago)
- Location:
- cpp/frams/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/util/extvalue.cpp
r522 r636 828 828 829 829 830 void ExtValue::modInt(paInt a) 831 { 832 if (a) 833 idata() %= a; 834 else 835 { 836 logPrintf("ExtValue", "modulo", LOG_ERROR, "Modulo by zero: %d%%0", idata()); 837 setInvalid(); 838 } 839 } 840 841 void ExtValue::modDouble(double a) 842 { 843 if (a == 0.0) 844 { 845 logPrintf("ExtValue", "modulo", LOG_ERROR, "Modulo by zero: %s%%0.0", getString().c_str()); 846 setInvalid(); 847 } 848 else 849 setDouble(fmod(ddata(),a)); 850 } 851 830 852 void ExtValue::operator%=(const ExtValue& src) 831 853 { 832 854 switch (type) 833 855 { 834 case TInt: idata() = idata() % src.getInt(); break;835 case TDouble: ddata() = fmod(ddata(),src.getDouble()); break;856 case TInt: modInt(src.getInt()); break; 857 case TDouble: modDouble(src.getDouble()); break; 836 858 837 859 case TString: -
cpp/frams/util/extvalue.h
r522 r636 168 168 void divInt(paInt a); 169 169 void divDouble(double a); 170 void modInt(paInt a); 171 void modDouble(double a); 170 172 171 173 int operator==(const ExtValue& src) const;
Note: See TracChangeset
for help on using the changeset viewer.