27 #include "ioflags.hpp"
35 std::ostream & operator << (std::ostream &s,
const cidotprecision& a)
throw()
38 <<
'[' << RndDown << a.reinf <<
',' << RndUp << a.resup <<
']' <<
','
39 <<
'[' << RndDown << a.iminf <<
',' << RndUp << a.imsup <<
']'
47 s << SaveOpt << RndDown << a.reinf;
49 s << RndUp << a.resup;
51 s << RndDown << a.iminf;
53 s << RndUp << a.imsup << RestoreOpt;
58 std::istream & operator >> (std::istream &s,
cidotprecision &a)
throw(ERROR_CIDOTPRECISION_EMPTY_INTERVAL)
62 skipwhitespacesandputback (s,
'(');
63 skipwhitespacesandputback (s,
'[');
64 s >> SaveOpt >> RndDown >> a.reinf;
65 skipwhitespacesandputback (s,
',');
67 skipwhitespacesandputback (s,
']');
68 skipwhitespacesandputback (s,
',');
69 skipwhitespacesandputback (s,
'[');
70 s >> RndDown >> a.iminf;
71 skipwhitespacesandputback (s,
',');
72 s >> RndUp >> a.imsup >> RestoreOpt;
76 skipeolnflag =
false, inpdotflag =
true;
77 c = skipwhitespaces (s);
78 if (inpdotflag && c !=
']')
83 skipeolnflag =
false, inpdotflag =
true;
84 c = skipwhitespaces (s);
85 if (inpdotflag && c !=
')')
89 if (a.reinf > a.resup || a.iminf > a.imsup)
90 cxscthrow(ERROR_CIDOTPRECISION_EMPTY_INTERVAL(
"std::istream & operator >> (std::istream &s, cidotprecision &a)"));
95 std::string & operator >> (std::string &s,
cidotprecision &a)
throw(ERROR_CIDOTPRECISION_EMPTY_INTERVAL)
97 s = skipwhitespacessinglechar (s,
'(');
98 s = skipwhitespacessinglechar (s,
'[');
99 s = s >> SaveOpt >> RndDown >> a.reinf;
100 s = skipwhitespacessinglechar (s,
',');
101 s = s >> RndUp >> a.resup;
102 s = skipwhitespacessinglechar (s,
']');
103 s = skipwhitespacessinglechar (s,
',');
104 s = skipwhitespacessinglechar (s,
'[');
105 s = s >> RndDown >> a.iminf;
106 s = skipwhitespacessinglechar (s,
',');
107 s = s >> RndUp >> a.iminf >> RestoreOpt;
108 s = skipwhitespaces (s);
111 s = skipwhitespaces (s);
115 if (a.reinf > a.resup || a.iminf > a.imsup)
116 cxscthrow(ERROR_CIDOTPRECISION_EMPTY_INTERVAL(
"std::string & operator >> (std::string &s, cidotprecision &a)"));
121 void operator >>(
const std::string &s,
cidotprecision &a)
throw(ERROR_CIDOTPRECISION_EMPTY_INTERVAL)
126 void operator >>(
const char *s,
cidotprecision &a)
throw(ERROR_CIDOTPRECISION_EMPTY_INTERVAL)
136 a.reinf.ptr(),a.iminf.ptr(),
137 a.resup.ptr(),a.imsup.ptr(),
138 *(a_cinv*)&b,*(a_cinv*)&c);