(self, args)
return self._values.new_single().from_int(self._seed).idiv(
            self._values.new_single().from_int(self._period)
        )
Get a value from the random number generator.
Get a value from the random number generator.
Get a value from the random number generator .
def rnd_(self, args):
        """Get a value from the random number generator."""
        f, = args
        if f is None:
            # RND
            self._cycle()
        else:
            f = values.to_single(f)
            if f.is_zero():
                # RND(0) returns last value
                pass
            else:
                if f.is_negative():
                    # re-seed with integer value of mantissa
                    # so RND(-1) does not mean n==-1 but n==-2**23
                    self._seed = -f.mantissa()
                self._cycle()
        # seed/period
        return self._values.new_single().from_int(self._seed).idiv(
            self._values.new_single().from_int(self._period)
        )
def rnd_ ( self , args ) : f , = args if f is None : # RND self . _cycle ( ) else : f = values . to_single ( f ) if f . is_zero ( ) : # RND(0) returns last value pass else : if f . is_negative ( ) : # re-seed with integer value of mantissa # so RND(-1) does not mean n==-1 but n==-2**23 self . _seed = - f . mantissa ( ) self . _cycle ( ) # seed/period return self . _values . new_single ( ) . from_int ( self . _seed ) . idiv ( self . _values . new_single ( ) . from_int ( self . _period ) )