All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.hellocuriosity.providers.DoubleProvider.kt Maven / Gradle / Ivy

package io.github.hellocuriosity.providers

import kotlin.random.Random

/**
 * Auto generates a Double between two values
 *
 * @param min minimum value
 * @param max maximum value
 * @param random random generator
 *
 * @return Double instance
 */
class DoubleProvider(
    private val min: Double = Double.MIN_VALUE,
    private val max: Double = Double.MAX_VALUE,
    private val random: Random = Random,
) : Provider {
    override fun get(): Double = random.nextDouble(min, max)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy