MCPcopy Create free account
hub / github.com/csmith-project/csmith / RandomDigits

Method RandomDigits

src/DefaultRndNumGenerator.cpp:206–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206std::string
207DefaultRndNumGenerator::RandomDigits( int num )
208{
209 if (!CGOptions::is_random())
210 return AbsRndNumGenerator::RandomDigits(num);
211
212 std::string str;
213 const char* dec1 = AbsRndNumGenerator::get_dec1();
214 while (num--) {
215 int x = genrand() % 10;
216 str += dec1[x];
217 seq_->add_number(x, 10, rand_depth_);
218 rand_depth_++;
219 }
220 return str;
221}
222

Callers

nothing calls this directly

Calls 2

RandomDigitsFunction · 0.85
add_numberMethod · 0.45

Tested by

no test coverage detected