# Question:apparently non-existential procedure called by rand

## Question:apparently non-existential procedure called by rand

Maple

I just need someone to explain to me why the following occurs:

 >
 >
 rand := proc(r::{posint, numeric .. numeric}, \$)    1   if nargs = 0 then    2     RandomTools:-MersenneTwister:-GenerateInteger()        else    3     try    4       if type(r,('numeric') .. ('numeric')) then    5         if rhs(r) < lhs(r) then    6           error "invalid range, end points are out of order"              elif not type(r,('integer') .. ('integer')) then    7           return () -> RandomTools:-Generate(float(('range') = r,('method') = ('uniform')))              end if            end if;    8       return RandomTools:-MersenneTwister:-NewGenerator(('range') = r)          catch :    9       error          end try        end if end proc
 >
 >
 RandomTools:-MersenneTwister:-GenerateInteger := proc({range::{integer, integer .. integer} := 1000000000000}, \$) local bits, divisor, offset;    1   if nargs = 0 then    2     return MTKernelInterface(4)        end if;    3   if type(range,'integer') then    4     divisor := range;    5     offset := 0        else    6     if rhs(range) < lhs(range) then    7       error "illegal range, end points out of order"          end if;    8     if lhs(range) = rhs(range) then    9       return lhs(range)          end if;   10     offset := lhs(range);   11     divisor := rhs(range)-offset+1        end if;   12   if divisor = 0 then   13     return offset        end if;   14   bits := MTKernelInterface(5,divisor);   15   MTKernelInterface(6,divisor,bits)+offset end proc
 >
 >
 >
 >