Java Lambda - LongToDoubleFunction applyAsDouble example








LongToDoubleFunction applyAsDouble applies this function to the given argument.

Syntax

applyAsDouble has the following syntax.

double applyAsDouble(long value)

Example

The following example shows how to use applyAsDouble.

import java.util.function.LongToDoubleFunction;
//w  ww  . j  a  v a2 s . c  o m
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.