Ruby provides several methods to generate random numbers, primarily via the Random class.
Random
Rounding numbers isn’t new—humans have been doing it for centuries to make calculations easier or to work within the limits of their tools.
Ruby makes handling complex numbers a breeze.