com.ibm.streams.function.samples.math

Class MathFunctions

  • java.lang.Object
    • com.ibm.streams.function.samples.math.MathFunctions


  • public class MathFunctions
    extends java.lang.Object
    Sample mathematical SPL Java native functions. Functions that call static methods in java.lang.Math or org.apache.commons.math.util.MathUtils and are annotated with Function to expose them as SPL native functions.
    The SPL namespace of the functions is defined by the Namespace annotation applied to this class's package com.ibm.streams.function.samples.math.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static double cosh(double v)
      Returns the hyperbolic cosine of a double value.
      static long factorial(int n)
      Returns n! (n factorial).
      static double hypot(double x, double y)
      Returns √(x2 + y2).
      static double sinh(double v)
      Returns the hyperbolic sine of a double value.
      static double tanh(double v)
      Returns the hyperbolic tangent of a double value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • cosh

        @Function(description="Returns the hyperbolic cosine of a `float64` value.")
        public static double cosh(double v)
        Returns the hyperbolic cosine of a double value.
        Parameters:
        v - The value to calculate the hyperbolic cosine of.
        Returns:
        The hyperbolic cosine of v.
      • sinh

        @Function(description="Returns the hyperbolic sine of a `float64` value.")
        public static double sinh(double v)
        Returns the hyperbolic sine of a double value.
        Parameters:
        v - The value to calculate the hyperbolic sine of.
        Returns:
        The hyperbolic sine of v.
      • tanh

        @Function(description="Returns the hyperbolic tangent of a `float64` value.")
        public static double tanh(double v)
        Returns the hyperbolic tangent of a double value.
        Parameters:
        v - The value to calculate the hyperbolic tangent of.
        Returns:
        The hyperbolic tangent of v.
      • hypot

        @Function(name="hypotenuse",
                  description="Returns the square root of `x` squared plus `y` squared.")
        public static double hypot(double x,
                                                                                                                                                  double y)
        Returns √(x2 + y2).
        Parameters:
        x - a value
        y - a value
        Returns:
        √(x2 + y2)
      • factorial

        @Function(description="Returns `n!` (`n` factorial).")
        public static long factorial(int n)
        Returns n! (n factorial).
        Parameters:
        n - Value to calculate the factorial of.
        Returns:
        n!