io.virtdata.libbasics.shared.from_double.to_float.DoubleToFloat Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of virtdata-lib-realer Show documentation
Show all versions of virtdata-lib-realer Show documentation
With inspiration from other libraries
package io.virtdata.libbasics.shared.from_double.to_float;
import io.virtdata.annotations.ThreadSafeMapper;
import java.util.function.DoubleFunction;
/**
* Convert the input double value to the closest float value.
*/
@ThreadSafeMapper
public class DoubleToFloat implements DoubleFunction {
@Override
public Float apply(double value) {
return (float) value;
}
}