Nyquist / XLISP 2.0  -  Contents | Tutorials | Examples | Reference

real-random


Type:   -   Lisp function (closure)
Source:   -   misc.lsp

Syntax

(real-random from to)
from, to - the limits as integer or floating point numbers
returns - a random floating point number between from and to

In Nyquist, 'real-random' is implemented as a Lisp function:

(defun real-random (from to)
  (+ (* (rrandom) (- to from)) from))

Description

The 'real-random' function returns a random floating point number between 'from' and 'to'. See also rrandom, which is equivalent to:

(real-random 0 1))

Examples


See also rrandom.

  Back to Top


Nyquist / XLISP 2.0  -  Contents | Tutorials | Examples | Reference