This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Algorithm Used by the LabVIEW Random Number (0 - 1) Function

Updated Jan 9, 2026

Reported In

Software

  • LabVIEW

Issue Details

What is the algorithm used by the LabVIEW Random Number (0 - 1) function, and what is its period?

Solution

The LabVIEW Random Number (0 - 1) function produces numbers seeded by the system clock. When generating random numbers, a "seed" is a starting number that initializes a random number generator. Refer to [External] Random Seed for a more detailed explanation of seeds.

 

The numbers produced are evenly distributed between 0 and 1, excluding the number 1. The algorithm is based on the use of multiple Multiplicative Congruential Generators (MCGs), also known as Lehmer Generators. Refer to [External] Lehmer Random Number Generator for a detailed explanation of how MCGs work.

 

This implementation improves the frequency of occurrence of values towards the extremes of the distribution. It has a periodicity of 6.95 * 10^12 random numbers before the cycle repeats. 



A detailed explanation of the algorithm can be found in "An Efficient and Portable Pseudo-random number generator", Applied Statistics 31 (1982), 188-190 by B.A. Wichmann and I.D. Hill.

Additional Information

For applications that require completely different sequences for generating, for example a universally unique identifier (UUID) and not a pseudorandom generator, it is recommended to use a different method such as an external GUID generator.

 

How to Generate a MessageID/GUID/UUID With LabVIEW? shows an example of using .NET GUID functions to generate a unique identifier.