MCPcopy Create free account
hub / github.com/Gecode/gecode / randFValDown

Function randFValDown

test/float.cpp:108–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106namespace Test { namespace Float {
107
108 Gecode::FloatNum randFValDown(Gecode::FloatNum l, Gecode::FloatNum u, Gecode::Support::RandomGenerator& rand) {
109 using namespace Gecode;
110 using namespace Gecode::Float;
111 Rounding r;
112 return
113 r.add_down(
114 l,
115 r.mul_down(
116 r.div_down(
117 rand(static_cast<unsigned int>(Int::Limits::max)),
118 static_cast<FloatNum>(Int::Limits::max)
119 ),
120 r.sub_down(u,l)
121 )
122 );
123 }
124
125 Gecode::FloatNum randFValUp(Gecode::FloatNum l, Gecode::FloatNum u, Gecode::Support::RandomGenerator& rand) {
126 using namespace Gecode;

Callers 1

pruneMethod · 0.85

Calls 4

add_downMethod · 0.45
mul_downMethod · 0.45
div_downMethod · 0.45
sub_downMethod · 0.45

Tested by

no test coverage detected