MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / read

Method read

Miscellaneous/BigInt.cpp:92–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 read(s);
91 }
92 void read(const string& s) {
93 sgn = 1;
94 a.clear();
95 int k = 0;
96 for (; k < s.size() && (s[k] == '-' || s[k] == '+'); k++)
97 if (s[k] == '-') sgn = -sgn;
98 for (int i = s.size() - 1; i >= k; i -= DIG) {
99 int x = 0;
100 for (int j = max(k, i - DIG + 1); j <= i; j++) x = x * 10 + s[j] - '0';
101 a.push_back(x);
102 }
103 trim();
104 }
105 friend istream& operator>>(istream &in, BigInt &v) {
106 string s;
107 in >> s;

Callers 1

BigIntClass · 0.80

Calls 3

push_backMethod · 0.80
clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected