MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / randomreal

Method randomreal

src/ap.cpp:1020–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1018}
1019
1020double ap::randomreal()
1021{
1022 int i1 = rand();
1023 int i2 = rand();
1024 while(i1==RAND_MAX)
1025 i1 =rand();
1026 while(i2==RAND_MAX)
1027 i2 =rand();
1028 double mx = RAND_MAX;
1029 return (i1+i2/mx)/mx;
1030}
1031
1032int ap::randominteger(int maxv)
1033{ return rand()%maxv; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected