LongToDoubleFunction example
Description
LongToDoubleFunction represents a function that accepts a long-valued argument and produces a double-valued result. This is the long-to-double primitive specialization for Function.
Example
The following example shows how to use LongToDoubleFunction
.
import java.util.function.LongToDoubleFunction;
//from w w w.j a va2s . c om
public class Main {
public static void main(String[] args) {
LongToDoubleFunction i = (l) -> Math.sin(l);
System.out.println(i.applyAsDouble(Long.MAX_VALUE));
}
}
The code above generates the following result.
Home »
Java Lambda »
java.util.function Reference »
Java Lambda »
java.util.function Reference »