# Decimal Random Number Generator

Omni's decimal random number generator will assist you in your math or programming tasks by producing as many uniformly distributed random decimal numbers as you need and from the range you need. In the article below, we will briefly explain what random and pseudo-random decimals are.

## What is a random number generator?

A random (or rather *pseudo*-random) number generator is an **algorithm** that outputs a sequence of numbers. These numbers should follow **no discernible pattern**, i.e., it should not be possible to **predict** the next number of the sequence.

Since there's an algorithm behind the generation procedure, these numbers are not truly random yet they are **good enough** for most applications. What our decimal random number generator produces is in fact a sequence of pseudo-random decimal numbers.

## Decimal vs integer random numbers

A **decimal number** is a number written in the base-10 system, i.e., the number system that is most commonly used nowadays. Examples of decimal numbers are `0.33, 2, 2.34`

, etc.

A decimal number consists of a **whole number part and a fractional part**. For example, `2.34`

has `2`

as its whole number part and `0.34`

as its fractional part. There is no whole number part in `0.33`

, while `2`

has no fractional part. The latter number can also be written as `2.0`

. It is, in fact, an example of an **integer**, which is a decimal number with no fractional part.

When it comes to **drawing random numbers**, an important difference between integers and decimal numbers is that in every range `[a,b]`

, there are finitely many integers but **infinitely many decimal numbers**. If we draw decimal numbers from any continuous distribution, in particular from the uniform distribution, then the **probability of getting duplicates is zero**.

## How to use this random number generator with decimals?

Our random number generator with decimals is really straightforward to use:

- Specify the
**range**from which you want to draw. - Tell us
**how many numbers you want**. - If you wish, you may adjust the
**precision, i.e., the number of decimal places**. - Our decimal random number generator can sort the numbers it produced - just switch the
`Sort`

option to`Yes`

. - Similarly, you can choose between
`List`

and`Column`

output.

🙋 Enter ** 0** as

`Precision`

to produce integers with the help of our random decimal number generator.## Related Omni calculators

Done with our random number generator with decimals? Here's a bunch of other Omni tools which can help you learn more about random numbers and probability:

## FAQ

### How do I generate a random number from a given range?

If you want to generate a random number from the interval `[a, b]`

:

- Generate a random number from the interval
`[0, 1]`

. - Multiply this number by
`(b - a)`

. - Add
`a`

to the result of Step 2. - That's it! What you got in Step 3 is a random number from
`[a,b]`

.

### Can I express every integer as a decimal?

**Yes**, every integer can be expressed as a decimal number. In fact, there are two ways to do that: for example, the integer `2`

can be expressed as `2`

and as `1.999…`

(with the `9`

repeating infinitely many times). In computer science, we would also consider `2.0`

or `2.000`

as different from `2`

.

### How do I obtain true random numbers?

Random numbers generated by computer algorithms are, in fact, *pseudo*-random: they do follow some pattern, yet a highly complicated one. To get a *true* random number, we can exploit various **physical systems**, in particular quantum systems.