Last updated

Notes

- To generate a negative random number, precede the number with a minus '-' sign.
- To generate an even random number, a random number is first generated, it is then checked to see if it's even or odd, it's returned if even.

If it is odd, +1 is added to it to make it even, and will be returned only if the random number + 1 is not greater than the max. number. If it is greater than the maximum number, -1 is added to the random number to make it even and will be returned only if the random number -1 is not less than the min. number. If all these conditions fail, the random number is returned.

Similar approach is used for all the output types. - Max number which can be generated is 9223372036854775807.