NumberLike


type NumberLike

A number-like type. Such a type is used in the documentation as a placeholder for generic parameters and return values that can take on a variety of types. Those types are defined as:

  1. some core type T (see below),
  2. a class type representing a delayed expression evaluating to T, derived from Expression,
  3. a struct type representing a delayed form evaluating to T, derived from Form, and
  4. the future type T!.

NumberLike includes the full set of core types, while various subtypes of it are defined that accept only subsets, as below.

Type Real core types Integer core types Boolean core types
NumberLike Real, Real[_], Real[_,_] Integer, Integer[_], Integer[_,_] Boolean, Boolean[_], Boolean[_,_]
NumberScalarLike Real Integer Boolean
NumberVectorLike Real[_] Integer[_] Boolean[_]
NumberMatrixLike Real[_,_] Integer[_,_] Boolean[_,_]
RealLike Real, Real[_], Real[_,_]
RealScalarLike Real
RealVectorLike Real[_]
RealMatrixLike Real[_,_]
IntegerLike Integer, Integer[_], Integer[_,_]
IntegerScalarLike Integer
IntegerVectorLike Integer[_]
IntegerMatrixLike Integer[_,_]
BooleanLike Boolean, Boolean[_], Boolean[_,_]
BooleanScalarLike Boolean
BooleanVectorLike Boolean[_]
BooleanMatrixLike Boolean[_,_]

These types are typically used in the documentation for mathematical functions and operators that accept both eager and lazy evaluation.