Skip to content

Variadic is_nan function #1232

Description

@andrjohns

Description

Several functions call is_nan multiple times using the || operator, such as in prim/scal/fun/grad_reg_inc_gamma:

  if (is_nan(a) || is_nan(z) || is_nan(g) || is_nan(dig))
    return std::numeric_limits<TP>::quiet_NaN();

This could be replaced with the introduction of a variadic version of is_nan (like that used for size_zero):

  if (is_nan(a, z, g, dig))
    return std::numeric_limits<TP>::quiet_NaN();

Current Version:

v2.19.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions