Return a random number between two values.

```
> num_random [minValue=0] maxValue
```

Round a whole number to the nearest multiple of another number.

```
> num_round_to_multiple_of "numberToRound" "roundToNearest"
# numberToRound: The number that needs to be rounded.
# roundToNearest: Round the number above to the nearest multiple of this number.
```

Return the whole number floor of a number.

```
> num_floor [-stdin] X
# X: A number, can be a decimal.
```

Return true if a number is a whole number.

```
> num_is_whole X
```

Return true if number is whole number and is even.

```
> num_is_even X
# X: Any whole number.
#
# **Example**
# ```
# num_is_even 4 && echo "True" || echo "False"
# True
# ```
```

Return true if number is whole number and is odd.

```
> num_is_odd X
# X: Any whole number.
#
# **Example**
# ```
# $(num_is_odd 4) && echo "True" || echo "False"
# False
# ```
```

Return true if first value is greater than the second. Decimals are allowed.

```
> num_is_gt isThisNum gtThanThisNum
# isThisNum: Integer or decimal.
# gtThanThisNum: Integer or decimal.
```

Return a range of whole numbers from beginning value to ending value.

```
> num_range start end
# start: Whole number to start with.
# end: Whole number to end with.
```

Get max from a series of numbers. Numbers are supplied as argments or standard input. Decimals are allowable.

```
> num_max [X...]
# X: One or more numbers separated by spaces.
```

Get min from a series of numbers. Numbers are supplied as argments or standard input. Decimals are allowable.

```
> num_min [X...]
# X: One or more numbers separated by spaces.
```

Sum a series of integer or decimal numbers.

```
> num_sum [-stdin] [-decimals,-d X] [X...]
# decimals: Specify the # of decimals. Defaults to zero.
# -stdin: Read from standard input.
# X: One or more numbers separated by spaces.
```

Avg a series of numbers. Numbers are supplied as argments or standard input. Decimals are allowable.

```
> num_avg [X...]
# X: One or more numbers separated by spaces.
```

Get standard deviation from a series of numbers. Numbers are supplied as argments or standard input. Decimals are allowable.

```
> num_stddev [X...]
# X: One or more numbers separated by spaces.
```

Return true if input value is a number. Decimals are allowable.

```
> num_is_num X
# X: The variable or string being tested.
```

Throw error and return true if provided value is not a number.

```
> num_raise_is_not_a_number "source" X
# source: Source of error.
# X: Expected number.
```

Changes numbers like 08.1 to 8.1, because bash will interpret the former as an octal.

Google “bash value too great for base” to understand more. At the time of this writing it is just used to strip leading zeros from some variables in the cron.sh library.

This function also reads from standard input.

```
> num_correct_for_octal_error [-stdin | X ]
# X: Integer or decimal value with potential leading zeros.
```

Return true if the number is greater than zero. Works with decimals.

```
> num_is_gt_zero X
# X: A number.
```

Ext true if the number is zero. Works with decimals.

```
> num_is_zero X
# X: A number.
```