Java Lambda - LongToDoubleFunction example

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.


  1. LongToDoubleFunction applyAsDouble


The following example shows how to use LongToDoubleFunction.

import java.util.function.LongToDoubleFunction;
// w w w  .  j  a v a 2  s . com
public class Main {

  public static void main(String[] args) {
    LongToDoubleFunction i = (l) -> Math.sin(l);

The code above generates the following result.