UnaryFunction

A function that accepts a single double and returns a double result. This is used to represent arbitrary mapping functions for converting units to and from a base unit representation. Temperature units, in particular, typically have an offset from a value in Kelvin and may have a multiplication factor added in, which means that units cannot always be represented as simple ratios of their base units.

Since

1.0.0-pre

Inheritors

Properties

Link copied to clipboard
The identity function that simply returns the input value.

Functions

Link copied to clipboard
abstract fun apply(input: Double): Double
Applies this function to the input value and returns the result.
Link copied to clipboard
open fun div(divisor: Double): UnaryFunction
Creates a composite function h(x) such that h(x) = 1/k * f(x).
open fun div(divisor: UnaryFunction): UnaryFunction
Creates a composite function h(x) such that h(x) = f(x) / g(x).
Link copied to clipboard
open fun exp(exponent: Double): UnaryFunction
Creates a composite function h(x) such that h(x) = f(x) ^ k.
open fun exp(exponent: UnaryFunction): UnaryFunction
Creates a composite function h(x) such that h(x) = f(x) ^ g(x).
Link copied to clipboard
open fun mult(multiplier: Double): UnaryFunction
Creates a composite function h(x) such that h(x) = k * f(x).
open fun mult(multiplier: UnaryFunction): UnaryFunction
Creates a composite function h(x) such that h(x) = f(x) * g(x).
Link copied to clipboard
Constructs a new function that first calls this function, then passes the result to another as input.