Macaulay2 Engine
Loading...
Searching...
No Matches

◆ readInteger_mpz_class()

mpz_class readInteger_mpz_class ( const std::string_view & str,
size_t & begin_loc,
size_t end_loc )

Definition at line 78 of file BasicPolyListParser.cpp.

79{
80 // if str[0] is a digit, find the value, and increment str past the number.
81 // if it is not: return 1, leave str unchanged.
82 mpz_class result;
83 if (not isdigit(str[begin_loc])) return result = 1;
84 result = 0;
85 size_t loc = begin_loc;
86 while (loc < end_loc and isdigit(str[loc]))
87 {
88 result *= 10;
89 result += str[loc] - '0';
90 loc++;
91 }
92 begin_loc = loc;
93 return result;
94}
VALGRIND_MAKE_MEM_DEFINED & result(result)

References result().

Referenced by parseBasicPoly().