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

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

Go to download

Model Forge is a library to automate model generation for automated testing.

The newest version!
package io.github.hellocuriosity.providers

import kotlin.random.Random

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy