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

io.virtdata.conversions.from_double.ToLong Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
package io.virtdata.conversions.from_double;

import io.virtdata.annotations.ThreadSafeMapper;

import java.util.function.DoubleToLongFunction;

@ThreadSafeMapper
public class ToLong implements DoubleToLongFunction {

    private final long scale;

    public ToLong(long scale) {
        this.scale = scale;
    }

    public ToLong() {
        this.scale = Long.MAX_VALUE;
    }

    @Override
    public long applyAsLong(double input) {
        return (long) (input % scale);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy