io.github.hellocuriosity.providers.FloatProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of model-forge Show documentation
Show all versions of model-forge Show documentation
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