LongToDoubleFunction applyAsDouble example

Description

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  w  w. j  a va  2  s  .com
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.